From 9e8fe96d9bacc116eee7e4496cacbeab3ad22ab1 Mon Sep 17 00:00:00 2001 From: cilix42 Date: Mon, 18 Aug 2008 18:23:58 +0000 Subject: [PATCH] Attempt to fix crashes in geometry tool which I don't see :-/ --- src/lpe-tool-context.cpp | 7 ++++++- src/lpe-tool-context.h | 2 ++ src/nodepath.cpp | 2 +- 3 files changed, 9 insertions(+), 2 deletions(-) diff --git a/src/lpe-tool-context.cpp b/src/lpe-tool-context.cpp index 9c8b5fea3..9b0a8380b 100644 --- a/src/lpe-tool-context.cpp +++ b/src/lpe-tool-context.cpp @@ -132,6 +132,10 @@ sp_lpetool_context_dispose(GObject *object) lc->sel_changed_connection.disconnect(); lc->sel_changed_connection.~connection(); + if (lc->_lpetool_message_context) { + delete lc->_lpetool_message_context; + } + G_OBJECT_CLASS(lpetool_parent_class)->dispose(object); } @@ -168,7 +172,8 @@ sp_lpetool_context_setup(SPEventContext *ec) ec->enableSelectionCue(); } - lc->_message_context = new Inkscape::MessageContext((ec->desktop)->messageStack()); + lc->_lpetool_message_context = new Inkscape::MessageContext((ec->desktop)->messageStack()); + lc->shape_editor->update_statusbar(); } diff --git a/src/lpe-tool-context.h b/src/lpe-tool-context.h index 2c3e6e36f..320fa5189 100644 --- a/src/lpe-tool-context.h +++ b/src/lpe-tool-context.h @@ -50,6 +50,8 @@ struct SPLPEToolContext : public SPPenContext { std::map *measuring_items; + Inkscape::MessageContext *_lpetool_message_context; + sigc::connection sel_changed_connection; sigc::connection sel_modified_connection; }; diff --git a/src/nodepath.cpp b/src/nodepath.cpp index e550bf6b7..20c6346e0 100644 --- a/src/nodepath.cpp +++ b/src/nodepath.cpp @@ -847,7 +847,7 @@ get_message_context(SPEventContext *ec) if (SP_IS_NODE_CONTEXT(ec)) { mc = SP_NODE_CONTEXT(ec)->_node_message_context; } else if (SP_IS_LPETOOL_CONTEXT(ec)) { - mc = ec->defaultMessageContext(); + mc = SP_LPETOOL_CONTEXT(ec)->_lpetool_message_context; } else { g_warning ("Nodepath should only be present in Node tool or Geometric tool."); return NULL; -- 2.30.2