Thanks to visit codestin.com
Credit goes to github.com

Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/runtime/classderived.cs
Original file line number Diff line number Diff line change
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