From: Brian Sullivan Date: Fri, 26 Apr 2019 21:07:29 +0000 (-0700) Subject: Revert "Added method ReleaseManagedCommandLine to release memory" X-Git-Tag: submit/tizen/20210909.063632~11030^2~1704^2~1 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=7abaecbc51db4e995827da52f747298ada946fd6;p=platform%2Fupstream%2Fdotnet%2Fruntime.git Revert "Added method ReleaseManagedCommandLine to release memory" This reverts commit dotnet/coreclr@1f2435763926f6068fc88a36a2b8dc49c263f271. Commit migrated from https://github.com/dotnet/coreclr/commit/78bfc4fbd634f34870e4c11f280c36b7ed696c9f --- diff --git a/src/coreclr/src/vm/ceeload.cpp b/src/coreclr/src/vm/ceeload.cpp index ab5d6e8..66b8d53 100644 --- a/src/coreclr/src/vm/ceeload.cpp +++ b/src/coreclr/src/vm/ceeload.cpp @@ -11700,7 +11700,7 @@ void SaveManagedCommandLine(LPCWSTR pwzAssemblyPath, int argc, LPCWSTR *argv) CONTRACTL_END; // Get the command line. - LPCWSTR osCommandLine = GetCommandLineW(); + LPCWSTR osCommandLine = GetCommandLineW(); #ifndef FEATURE_PAL // On Windows, osCommandLine contains the executable and all arguments. @@ -11737,17 +11737,6 @@ void SaveManagedCommandLine(LPCWSTR pwzAssemblyPath, int argc, LPCWSTR *argv) #endif } -// Release any memory that we allocated for the managed command line -void ReleaseManagedCommandLine() -{ - LIMITED_METHOD_CONTRACT; - -#ifdef FEATURE_PAL - delete[] s_pCommandLine; - s_pCommandLine = NULL; -#endif -} - static void ProfileDataAllocateScenarioInfo(ProfileEmitter * pEmitter, LPCSTR scopeName, GUID* pMvid) { CONTRACTL diff --git a/src/coreclr/src/vm/ceeload.h b/src/coreclr/src/vm/ceeload.h index adfefcc..407d969 100644 --- a/src/coreclr/src/vm/ceeload.h +++ b/src/coreclr/src/vm/ceeload.h @@ -3423,7 +3423,5 @@ struct VASigCookieEx : public VASigCookie LPCWSTR GetManagedCommandLine(); // Save the command line for the current process. void SaveManagedCommandLine(LPCWSTR pwzAssemblyPath, int argc, LPCWSTR *argv); -// Release any memory that we allocated for the managed command line -void ReleaseManagedCommandLine(); #endif // !CEELOAD_H_ diff --git a/src/coreclr/src/vm/corhost.cpp b/src/coreclr/src/vm/corhost.cpp index c588e31..6487c52 100644 --- a/src/coreclr/src/vm/corhost.cpp +++ b/src/coreclr/src/vm/corhost.cpp @@ -469,11 +469,6 @@ HRESULT CorHost2::ExecuteAssembly(DWORD dwAppDomainId, GCPROTECT_END(); - // When running under FEATURE_PAL, the SetCommandLineArgs call above will - // call SaveManagedCommandLine which will allocate memory using new WCHAR[] - // We can release this memory now. - // - ReleaseManagedCommandLine(); } UNINSTALL_UNWIND_AND_CONTINUE_HANDLER;