27 Apr
2004
27 Apr
'04
1:06 a.m.
On Mon, 2004-04-26 at 10:16, Carl Hetherington wrote:
There seem to be lots of ways of fixing this, and I'm really unsure as to which is best:
- Don't call sp_desktop_prepare_shutdown(). I can't see what it's
trying to achieve, given that everything it does will be performed by sp_desktop_dispose(). Also, sp_desktop_dispose() does the inkscape_remove_desktop before the selection = NULL, meaning that the crash will not occur.
- Rearrange sp_desktop_prepare_shutdown() to do things in the same order
as sp_desktop_dispose().
- Make text-edit.cpp look at the new SPSelection* that is passed in by
the SET_SELECTION event, rather than using SP_ACTIVE_DESKTOP. Then it could check for NULLness.
- Change inkscape_remove_desktop() to call selection->clear() rather
than SET_SELECTION to NULL. Then leave sp_desktop_dispose() to actually unref the SPSelection.
Any thoughts?
I would personally vote for 3, 4 _and_ 1. There will probably be some corner cases to work out, but it should significantly improve the design.
-mental