From 2adf86d21d42f7d225e0d2188109fbd031989cf4 Mon Sep 17 00:00:00 2001 From: Stefano Facchini Date: Fri, 20 Oct 2017 22:40:38 +0200 Subject: Unset the current tool early on shutdown. Before this commit, when the application is terminated we call the ::finish() method for the current tool, only after deleting the selection and other objects. But it may happen that the tool's finish() assume that the selection is still alive, making the application crash. (For instance, with the Bezier tool when the path is still not closed). Instead, unset the current tool early, when the Desktop object is removed from the application, before calling its ::destroy() method. --- src/widgets/desktop-widget.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'src/widgets/desktop-widget.cpp') diff --git a/src/widgets/desktop-widget.cpp b/src/widgets/desktop-widget.cpp index 571f920bf..f9c8e4ac6 100644 --- a/src/widgets/desktop-widget.cpp +++ b/src/widgets/desktop-widget.cpp @@ -736,10 +736,9 @@ static void sp_desktop_widget_dispose(GObject *object) g_signal_handlers_disconnect_by_func (G_OBJECT (dtw->canvas), (gpointer) G_CALLBACK (sp_desktop_widget_event), dtw); g_signal_handlers_disconnect_by_func (G_OBJECT (dtw->canvas_tbl), (gpointer) G_CALLBACK (canvas_tbl_size_allocate), dtw); - dtw->layer_selector->setDesktop(NULL); dtw->layer_selector->unreference(); - INKSCAPE.remove_desktop (dtw->desktop); // clears selection too + INKSCAPE.remove_desktop(dtw->desktop); // clears selection and event_context dtw->modified_connection.disconnect(); dtw->desktop->destroy(); Inkscape::GC::release (dtw->desktop); -- cgit v1.2.3