◐ Shell
clean mode source ↗

Fixed crash in finalizer of CLR types defined in Python, that survive engine shutdown by lostmsu · Pull Request #1260 · pythonnet/pythonnet

Expand Up @@ -857,7 +857,7 @@ public static void Finalize(IPythonDerivedType obj) { if (0 == Runtime.Py_IsInitialized() || Runtime.IsFinalizing) { self.gcHandle.Free(); if (self.gcHandle.IsAllocated) self.gcHandle.Free(); return; } } Expand All @@ -872,7 +872,7 @@ public static void Finalize(IPythonDerivedType obj) // If python's been terminated then just free the gchandle. if (0 == Runtime.Py_IsInitialized() || Runtime.IsFinalizing) { self.gcHandle.Free(); if (self.gcHandle.IsAllocated) self.gcHandle.Free(); return; }
Expand Down