Code

Attempt to fix crashes in geometry tool which I don't see :-/
authorcilix42 <cilix42@users.sourceforge.net>
Mon, 18 Aug 2008 18:23:58 +0000 (18:23 +0000)
committercilix42 <cilix42@users.sourceforge.net>
Mon, 18 Aug 2008 18:23:58 +0000 (18:23 +0000)
src/lpe-tool-context.cpp
src/lpe-tool-context.h
src/nodepath.cpp

index 9c8b5fea33725cd70a6ec5d112a860ce3a095ee5..9b0a8380b9de78b8d3a5596dd654e73f81f6cb0d 100644 (file)
@@ -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();
 }
index 2c3e6e36f5ea1df7930e8c3bd5f6c28f8725007d..320fa51896d8dad9a60f6e819e212b907cd9f612 100644 (file)
@@ -50,6 +50,8 @@ struct SPLPEToolContext : public SPPenContext {
 
     std::map<SPPath *, SPCanvasItem*> *measuring_items;
 
+    Inkscape::MessageContext *_lpetool_message_context;
+
     sigc::connection sel_changed_connection;
     sigc::connection sel_modified_connection;
 };
index e550bf6b76e8425568dc8cc5940468473cede60f..20c6346e03c7745bc4115862e42fbb466a14ae35 100644 (file)
@@ -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;