Poison code before deleting the handle.
authormateoatr <matorre@microsoft.com>
Mon, 9 Dec 2019 19:30:11 +0000 (19:30 +0000)
committermateoatr <matorre@microsoft.com>
Mon, 9 Dec 2019 19:30:11 +0000 (19:30 +0000)
Keep code consistent.

src/coreclr/src/vm/dllimportcallback.cpp

index 00ad444..2f6c009 100644 (file)
@@ -965,14 +965,14 @@ void UMEntryThunk::Terminate()
     }
     CONTRACTL_END;
 
+    m_code.Poison();
+
     if (GetObjectHandle())
     {
         DestroyLongWeakHandle(GetObjectHandle());
-        this->m_pObjectHandle = 0;
+        m_pObjectHandle = 0;
     }
 
-    m_code.Poison();
-
     s_thunkFreeList.AddToList(this);
 }