From: gustav_b Date: Wed, 11 Apr 2007 21:02:46 +0000 (+0000) Subject: Use the existing Inkscape::Event instead of creating a new one (and X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=8a5e1cba051d9e607c0e04e2a38ec6687625fc96;p=inkscape.git Use the existing Inkscape::Event instead of creating a new one (and leaking the old) when coalescing Inkscape::XML::Events in sp_document_maybe_done. --- diff --git a/src/document-undo.cpp b/src/document-undo.cpp index f37b53f89..9ce1dad60 100644 --- a/src/document-undo.cpp +++ b/src/document-undo.cpp @@ -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);