[Mono-devel-list] Patch that implements WaitForPendingFinalizers

Jeroen Frijters jeroen at sumatra.nl
Thu Apr 17 10:41:50 EDT 2003

Gonzalo Paniagua Javier wrote:
> When running some xsp stuff, noticed that sometimes the DB 
> connections where not being closed... Then I tried 
> WaitForPendingFinalizers to see if there was any connection 
> object pending finalization and realized that it was an empty 
> function.
> I've attached a patch for gc.c that solves this issue. It 
> also runs the finalizers upon domain shutdown so that the 
> finalizer in the attached finalizers-simple.cs is run.

I'm not sure if this is handled, but have you considered what happens if
the code inside the finalizer instantiates new objects that also have a
finalizer, you'll possibly be finalizing forever. I think that on
AppDomain unload Microsoft actually watches the number of objects on the
finalizer queue, and if it doesn't go down, it just stops calling the


More information about the Mono-devel-list mailing list