| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -28,6 +28,14 @@ public void TearDown() | |||
| 28 | 28 | private static void FullGCCollect() | |
| 29 | 29 | { | |
| 30 | 30 | GC.Collect(GC.MaxGeneration, GCCollectionMode.Forced); | |
| 31 | + try | ||
| 32 | + { | ||
| 33 | + GC.WaitForFullGCComplete(); | ||
| 34 | + } | ||
| 35 | + catch (NotImplementedException) | ||
| 36 | + { | ||
| 37 | + // Some clr runtime didn't implement GC.WaitForFullGCComplete yet. | ||
| 38 | + } | ||
| 31 | 39 | GC.WaitForPendingFinalizers(); | |
| 32 | 40 | } | |
| 33 | 41 | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -391,12 +391,13 @@ internal static void Shutdown(ShutdownMode mode) | |||
| 391 | 391 | GC.Collect(); | |
| 392 | 392 | try | |
| 393 | 393 | { | |
| 394 | - GC.WaitForPendingFinalizers(); | ||
| 394 | + GC.WaitForFullGCComplete(); | ||
| 395 | 395 | } | |
| 396 | 396 | catch (NotImplementedException) | |
| 397 | 397 | { | |
| 398 | 398 | // Some clr runtime didn't implement GC.WaitForFullGCComplete yet. | |
| 399 | 399 | } | |
| 400 | + GC.WaitForPendingFinalizers(); | ||
| 400 | 401 | PyGILState_Release(state); | |
| 401 | 402 | // Then release the GIL for good, if there is somehting to release | |
| 402 | 403 | // Use the unchecked version as the checked version calls `abort()` | |
| Back | FazBrowse Home | New Git URL |
0 commit comments