From 8a5e1cba051d9e607c0e04e2a38ec6687625fc96 Mon Sep 17 00:00:00 2001 From: gustav_b Date: Wed, 11 Apr 2007 21:02:46 +0000 Subject: [PATCH] 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. --- src/document-undo.cpp | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) 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); -- 2.30.2