@@ -278,7 +278,8 @@ internal static void Shutdown()
278
278
ClearClrModules ( ) ;
279
279
RemoveClrRootModule ( ) ;
280
280
281
- TryCollectingGarbage ( MaxCollectRetriesOnShutdown , forceBreakLoops : true ) ;
281
+ TryCollectingGarbage ( MaxCollectRetriesOnShutdown , forceBreakLoops : true ,
282
+ obj : true , derived : false , buffer : false ) ;
282
283
283
284
NullGCHandles ( ExtensionType . loadedExtensions ) ;
284
285
ClassManager . RemoveClasses ( ) ;
@@ -329,7 +330,8 @@ internal static void Shutdown()
329
330
330
331
const int MaxCollectRetriesOnShutdown = 20 ;
331
332
internal static int _collected ;
332
- static bool TryCollectingGarbage ( int runs , bool forceBreakLoops )
333
+ static bool TryCollectingGarbage ( int runs , bool forceBreakLoops ,
334
+ bool obj = true , bool derived = true , bool buffer = true )
333
335
{
334
336
if ( runs <= 0 ) throw new ArgumentOutOfRangeException ( nameof ( runs ) ) ;
335
337
@@ -342,7 +344,9 @@ static bool TryCollectingGarbage(int runs, bool forceBreakLoops)
342
344
GC . Collect ( ) ;
343
345
GC . WaitForPendingFinalizers ( ) ;
344
346
pyCollected += PyGC_Collect ( ) ;
345
- pyCollected += Finalizer . Instance . DisposeAll ( ) ;
347
+ pyCollected += Finalizer . Instance . DisposeAll ( disposeObj : obj ,
348
+ disposeDerived : derived ,
349
+ disposeBuffer : buffer ) ;
346
350
}
347
351
if ( Volatile . Read ( ref _collected ) == 0 && pyCollected == 0 )
348
352
{
0 commit comments