| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent 44a36dc commit 1fd6dc2
1 file changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -857,7 +857,7 @@ public static void Finalize(IPythonDerivedType obj) | |||
| 857 | 857 | { | |
| 858 | 858 | if (0 == Runtime.Py_IsInitialized() || Runtime.IsFinalizing) | |
| 859 | 859 | { | |
| 860 | - self.gcHandle.Free(); | ||
| 860 | + if (self.gcHandle.IsAllocated) self.gcHandle.Free(); | ||
| 861 | 861 | return; | |
| 862 | 862 | } | |
| 863 | 863 | } | |
@@ -872,7 +872,7 @@ public static void Finalize(IPythonDerivedType obj) | |||
| 872 | 872 | // If python's been terminated then just free the gchandle. | |
| 873 | 873 | if (0 == Runtime.Py_IsInitialized() || Runtime.IsFinalizing) | |
| 874 | 874 | { | |
| 875 | - self.gcHandle.Free(); | ||
| 875 | + if (self.gcHandle.IsAllocated) self.gcHandle.Free(); | ||
| 876 | 876 | return; | |
| 877 | 877 | } | |
| 878 | 878 | ||
| Back | FazBrowse Home | New Git URL |
0 commit comments