From 68616889b6eaf53f4e019f1566b7edf56e8ec521 Mon Sep 17 00:00:00 2001 From: Krzysztof Kosi??ski Date: Wed, 28 Jul 2010 00:29:47 +0200 Subject: Duplicate the undo key passed to sp_document_maybe_done, instead of simply assigning it. Allows the function to be used with dynamically created keys and fixes undo stack spam when adjusting filter parameter values (LP #579932). Fixed bugs: - https://launchpad.net/bugs/579932 (bzr r9661) --- src/document-undo.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'src/document-undo.cpp') diff --git a/src/document-undo.cpp b/src/document-undo.cpp index ae1c82e71..62259fa19 100644 --- a/src/document-undo.cpp +++ b/src/document-undo.cpp @@ -198,7 +198,9 @@ sp_document_maybe_done (SPDocument *doc, const gchar *key, const unsigned int ev doc->priv->undoStackObservers.notifyUndoCommitEvent(event); } - doc->actionkey = key; + if (doc->actionkey) + g_free(doc->actionkey); + doc->actionkey = key ? g_strdup(key) : NULL; doc->virgin = FALSE; doc->setModifiedSinceSave(); -- cgit v1.2.3