Release leaked ICorProfilerCallback9 in ~EEToProfInterfaceImpl (dotnet/coreclr#19106)
authorIlia <ki.stfu@gmail.com>
Tue, 24 Jul 2018 16:49:16 +0000 (19:49 +0300)
committerJan Kotas <jkotas@microsoft.com>
Tue, 24 Jul 2018 16:49:16 +0000 (09:49 -0700)
Bug: 19093

Commit migrated from https://github.com/dotnet/coreclr/commit/c72f69b878cc071b6bf9b9c0764159b48be8a8ee

src/coreclr/src/vm/eetoprofinterfaceimpl.cpp

index 3f32b5a..24bf171 100644 (file)
@@ -962,6 +962,13 @@ EEToProfInterfaceImpl::~EEToProfInterfaceImpl()
             m_pCallback8 = NULL;
         }
 
+        if (m_pCallback9 != NULL)
+        {
+            REMOVE_STACK_GUARD_FOR_PROFILER_CALL;
+            m_pCallback9->Release();
+            m_pCallback9 = NULL;
+        }
+
         // Only unload the V4 profiler if this is not part of shutdown.  This protects
         // Whidbey profilers that aren't used to being FreeLibrary'd.
         if (fIsV4Profiler && !g_fEEShutDown)