Quoting Bryce Harrington <bryce@...961...>:
Please review the remaining open bugs and let me know what you think the must-fix bugs are, and we'll sort out what needs to be done during the hard freeze phase as the next step.
The attached patch is needed to break a finalization cycle between SPDesktop and Inkscape::Selection.
I think the cycle would create a memory leak because both have finalizers (they both derive from GC::Finalized to make sure their destructors get called), and one finalizable object cannot be finalized and freed while another finalizable object is still pointing to it.
Here, clearOnceInaccessible is used to break the tie. It schedules Inkscape::Selection::_desktop to be set to NULL before finalization, allowing SPDesktop to finalize first.
(a better name would have been clearBeforeFinalization, come to think of it...)
Sorry I didn't get to this sooner, I still haven't had any time to do the required code review around the Desktop changes. But I think it's important to cover this bit for the release, at least.
Index: src/selection.cpp =================================================================== RCS file: /cvsroot/inkscape/inkscape/src/selection.cpp,v retrieving revision 1.59 diff -u -3 -r1.59 selection.cpp --- src/selection.cpp 4 Sep 2005 14:37:02 -0000 1.59 +++ src/selection.cpp 22 Sep 2005 22:23:26 -0000 @@ -48,6 +48,7 @@ _flags(0), _idle(0) { + clearOnceInaccessible(&_desktop); }
Selection::~Selection() {