| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -296,6 +296,7 @@ static void OnDomainUnload(object _, EventArgs __) | |||
| 296 | 296 | ||
| 297 | 297 | static void OnProcessExit(object _, EventArgs __) | |
| 298 | 298 | { | |
| 299 | + Runtime.ProcessIsTerminating = true; | ||
| 299 | 300 | Shutdown(); | |
| 300 | 301 | } | |
| 301 | 302 | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -92,6 +92,7 @@ internal static int GetRun() | |||
| 92 | 92 | } | |
| 93 | 93 | ||
| 94 | 94 | internal static bool HostedInPython; | |
| 95 | + internal static bool ProcessIsTerminating; | ||
| 95 | 96 | ||
| 96 | 97 | /// Initialize the runtime... | |
| 97 | 98 | /// </summary> | |
@@ -254,7 +255,7 @@ internal static void Shutdown() | |||
| 254 | 255 | ||
| 255 | 256 | var state = PyGILState_Ensure(); | |
| 256 | 257 | ||
| 257 | - if (!HostedInPython) | ||
| 258 | + if (!HostedInPython && !ProcessIsTerminating) | ||
| 258 | 259 | { | |
| 259 | 260 | // avoid saving dead objects | |
| 260 | 261 | TryCollectingGarbage(runs: 3); | |
| Back | FazBrowse Home | New Git URL |
0 commit comments