FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

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

Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension .cs  (1) All 1 file type selected
Viewed files
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Unified
Split
Hide whitespace
Diff view
Unified
Split
Hide whitespace
4 changes: 2 additions & 2 deletions src/runtime/classderived.cs
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
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

Back | FazBrowse Home | New Git URL