Code

Use the existing Inkscape::Event instead of creating a new one (and
authorgustav_b <gustav_b@users.sourceforge.net>
Wed, 11 Apr 2007 21:02:46 +0000 (21:02 +0000)
committergustav_b <gustav_b@users.sourceforge.net>
Wed, 11 Apr 2007 21:02:46 +0000 (21:02 +0000)
leaking the old) when coalescing Inkscape::XML::Events in sp_document_maybe_done.

src/document-undo.cpp

index f37b53f89c5d89c228d78dd5b9eb67c61aa3aeff..9ce1dad603fa8f59af769b9aef213d579b989939 100644 (file)
@@ -152,9 +152,8 @@ sp_document_maybe_done (SPDocument *doc, const gchar *key, const unsigned int ev
        }
 
        if (key && doc->actionkey && !strcmp (key, doc->actionkey) && doc->priv->undo) {
-                doc->priv->undo->data = 
-                    new Inkscape::Event(sp_repr_coalesce_log (((Inkscape::Event *)
-                                                               doc->priv->undo->data)->event, log));
+                ((Inkscape::Event *)doc->priv->undo->data)->event =
+                    sp_repr_coalesce_log (((Inkscape::Event *)doc->priv->undo->data)->event, log);
        } else {
                 Inkscape::Event *event = new Inkscape::Event(log, event_type, event_description);
                 doc->priv->undo = g_slist_prepend (doc->priv->undo, event);