File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -28,6 +28,14 @@ public void TearDown()
2828 private static void FullGCCollect ( )
2929 {
3030 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+ }
3139 GC . WaitForPendingFinalizers ( ) ;
3240 }
3341
Original file line number Diff line number Diff line change @@ -391,12 +391,13 @@ internal static void Shutdown(ShutdownMode mode)
391391 GC . Collect ( ) ;
392392 try
393393 {
394- GC . WaitForPendingFinalizers ( ) ;
394+ GC . WaitForFullGCComplete ( ) ;
395395 }
396396 catch ( NotImplementedException )
397397 {
398398 // Some clr runtime didn't implement GC.WaitForFullGCComplete yet.
399399 }
400+ GC . WaitForPendingFinalizers ( ) ;
400401 PyGILState_Release ( state ) ;
401402 // Then release the GIL for good, if there is somehting to release
402403 // Use the unchecked version as the checked version calls `abort()`
You can’t perform that action at this time.
0 commit comments