
I've just added another debugging category to the debug logging code, so now object finalization is reported in the log.
Finalization is a special step taken before freeing those objects which the collector cannot automatically clean up (e.g. because they need to release non-collector-managed resources).
Classes with finalizers include SPDocument and SPDesktop.
Try it out with latest SVN:
INKSCAPE_DEBUG_LOG=debug.xml INKSCAPE_DEBUG_FILTER=REFCOUNT,FINALIZERS src/inkscape
Open some documents, close them, and before closing the last one, go to the "About Memory" dialog and click "recalculate" a few times to make sure that a garbage collection pass gets run.
Then look at debug.xml. You can see not only when the finalization of an object happened, but also what debugging events (in this case refs/unrefs) happened during its finalizer.
-mental