Remove FreeLibrary call to unload CoreCLR (dotnet/coreclr#24317)
authorNext Turn <45985406+NextTurn@users.noreply.github.com>
Tue, 30 Apr 2019 18:38:18 +0000 (02:38 +0800)
committerJan Kotas <jkotas@microsoft.com>
Tue, 30 Apr 2019 18:38:18 +0000 (11:38 -0700)
Commit migrated from https://github.com/dotnet/coreclr/commit/bb83fe67e0027d93c0d04d921163efa0e414b047

src/coreclr/src/coreclr/hosts/coreconsole/coreconsole.cpp
src/coreclr/src/coreclr/hosts/corerun/corerun.cpp

index e3813d4..a321f8b 100644 (file)
@@ -176,15 +176,6 @@ public:
             }
     }
 
-    ~HostEnvironment() {
-        if(m_coreCLRModule) {
-            // Free the module. This is done for completeness, but in fact CoreCLR.dll 
-            // was pinned earlier so this call won't actually free it. The pinning is
-            // done because CoreCLR does not support unloading.
-            ::FreeLibrary(m_coreCLRModule);
-        }
-    }
-
     bool TPAListContainsFile(_In_z_ wchar_t* fileNameWithoutExtension, _In_reads_(countExtensions) const wchar_t** rgTPAExtensions, int countExtensions)
     {
         if (!m_tpaList.CStr()) return false;
index e1864c8..4f06da7 100644 (file)
@@ -152,15 +152,6 @@ public:
             }
     }
 
-    ~HostEnvironment() {
-        if(m_coreCLRModule) {
-            // Free the module. This is done for completeness, but in fact CoreCLR.dll 
-            // was pinned earlier so this call won't actually free it. The pinning is
-            // done because CoreCLR does not support unloading.
-            ::FreeLibrary(m_coreCLRModule);
-        }
-    }
-
     bool TPAListContainsFile(_In_z_ wchar_t* fileNameWithoutExtension, _In_reads_(countExtensions) const wchar_t** rgTPAExtensions, int countExtensions)
     {
         if (m_tpaList.IsEmpty()) return false;