Release leaked ICorProfilerCallback9 in ~EEToProfInterfaceImpl (#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

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)