Code

Patch from Debian bug tracker from Daniel Kahn Gillmor
[inkscape.git] / src / nodepath.cpp
index be0a2eb1e28524860aba9d96e656af737920b098..69827bd848552cf30a67afce908b5d2fad9f871a 100644 (file)
@@ -2219,7 +2219,10 @@ sp_node_selected_delete_segment(void)
         //Copy everything after 'end' to a new subpath
        Inkscape::NodePath::SubPath *t = sp_nodepath_subpath_new(nodepath);
         for (curr=end ; curr ; curr=curr->n.other) {
-            sp_nodepath_node_new(t, NULL, (Inkscape::NodePath::NodeType)curr->type, (NRPathcode)curr->code,
+            NRPathcode code = (NRPathcode) curr->code;
+            if (curr == end)
+                code = NR_MOVETO;
+            sp_nodepath_node_new(t, NULL, (Inkscape::NodePath::NodeType)curr->type, code,
                                  &curr->p.pos, &curr->pos, &curr->n.pos);
         }
 
@@ -3319,7 +3322,6 @@ static void node_handle_ungrabbed(SPKnot *knot, guint state, gpointer data)
     }
 
     sp_nodepath_update_repr(n->subpath->nodepath, _("Move node handle"));
-    sp_canvas_end_forced_full_redraws(n->subpath->nodepath->desktop->canvas);
 }
 
 /**
@@ -4035,6 +4037,7 @@ static void sp_nodepath_node_destroy(Inkscape::NodePath::Node *node)
         g_signal_handlers_disconnect_by_func(G_OBJECT(node->p.knot), (gpointer) G_CALLBACK(node_handle_moved), node);
         g_signal_handlers_disconnect_by_func(G_OBJECT(node->p.knot), (gpointer) G_CALLBACK(node_handle_event), node);
         g_object_unref(G_OBJECT(node->p.knot));
+        node->p.knot = NULL;
     }
 
     if (node->n.knot) {
@@ -4045,6 +4048,7 @@ static void sp_nodepath_node_destroy(Inkscape::NodePath::Node *node)
         g_signal_handlers_disconnect_by_func(G_OBJECT(node->n.knot), (gpointer) G_CALLBACK(node_handle_moved), node);
         g_signal_handlers_disconnect_by_func(G_OBJECT(node->n.knot), (gpointer) G_CALLBACK(node_handle_event), node);
         g_object_unref(G_OBJECT(node->n.knot));
+        node->n.knot = NULL;
     }
 
     if (node->p.line)