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.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'src/document.cpp') diff --git a/src/document.cpp b/src/document.cpp index eff6d6e81..eebc50a98 100644 --- a/src/document.cpp +++ b/src/document.cpp @@ -211,7 +211,10 @@ SPDocument::~SPDocument() { inkscape_unref(); keepalive = FALSE; } - + if (actionkey) { + g_free(actionkey); + actionkey = NULL; + } //delete this->_whiteboard_session_manager; } -- cgit v1.2.3 From b866548d43ef89eefbbec860e0935f8f2505277f Mon Sep 17 00:00:00 2001 From: "Jon A. Cruz" Date: Tue, 27 Jul 2010 18:57:53 -0700 Subject: Safer fix for bug #579932 that won't leak memory. (bzr r9662) --- src/document.cpp | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) (limited to 'src/document.cpp') diff --git a/src/document.cpp b/src/document.cpp index eebc50a98..3c9f7e5ed 100644 --- a/src/document.cpp +++ b/src/document.cpp @@ -92,7 +92,7 @@ SPDocument::SPDocument() : base(0), name(0), priv(0), // reset in ctor - actionkey(0), + actionkey(), modified_id(0), rerouting_handler_id(0), profileManager(0), // deferred until after other initialization @@ -211,10 +211,6 @@ SPDocument::~SPDocument() { inkscape_unref(); keepalive = FALSE; } - if (actionkey) { - g_free(actionkey); - actionkey = NULL; - } //delete this->_whiteboard_session_manager; } @@ -291,7 +287,7 @@ void SPDocument::collectOrphans() { void SPDocument::reset_key (void */*dummy*/) { - actionkey = NULL; + actionkey.clear(); } SPDocument * -- cgit v1.2.3