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/desktop.cpp | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) (limited to 'src/desktop.cpp') diff --git a/src/desktop.cpp b/src/desktop.cpp index 61a64fe22..f798079fd 100644 --- a/src/desktop.cpp +++ b/src/desktop.cpp @@ -322,7 +322,6 @@ SPDesktop::init (SPNamedView *nv, SPCanvas *aCanvas, Inkscape::UI::View::EditWid // canvas_debug = sp_canvas_item_new (main, SP_TYPE_CANVAS_DEBUG, NULL); } - void SPDesktop::destroy() { _destroy_signal.emit(this); @@ -331,6 +330,7 @@ void SPDesktop::destroy() delete snapindicator; snapindicator = NULL; } + if (temporary_item_list) { delete temporary_item_list; temporary_item_list = NULL; @@ -356,12 +356,6 @@ void SPDesktop::destroy() g_signal_handlers_disconnect_by_func(G_OBJECT (main), (gpointer) G_CALLBACK(sp_desktop_root_handler), this); g_signal_handlers_disconnect_by_func(G_OBJECT (drawing), (gpointer) G_CALLBACK(_arena_handler), this); - if (event_context) { - event_context->finish(); - delete event_context; - event_context = NULL; - } - delete layers; if (layer_manager) { -- cgit v1.2.3