diff options
| author | Stefano Facchini <stefano.facchini@gmail.com> | 2017-10-20 20:40:38 +0000 |
|---|---|---|
| committer | Stefano Facchini <stefano.facchini@gmail.com> | 2017-11-13 09:28:49 +0000 |
| commit | 2adf86d21d42f7d225e0d2188109fbd031989cf4 (patch) | |
| tree | 7fa2675fe92d4d05d31aa410d50d6b0934b17f0e /src/desktop.cpp | |
| parent | Refactor SPDesktop::setEventContext to allow for unsetting the current tool (diff) | |
| download | inkscape-2adf86d21d42f7d225e0d2188109fbd031989cf4.tar.gz inkscape-2adf86d21d42f7d225e0d2188109fbd031989cf4.zip | |
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.
Diffstat (limited to 'src/desktop.cpp')
| -rw-r--r-- | src/desktop.cpp | 8 |
1 files changed, 1 insertions, 7 deletions
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) { |
