From 79756cc36f3eb4588843a785c31ff5d92c6e129d Mon Sep 17 00:00:00 2001 From: twanvl Date: Fri, 20 Oct 2006 14:28:28 +0000 Subject: [PATCH] fixed memory leak git-svn-id: svn://svn.code.sf.net/p/magicseteditor/code/trunk@44 0fc631ac-6414-0410-93d0-97cfa31319b6 --- src/util/action_stack.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/util/action_stack.cpp b/src/util/action_stack.cpp index fcbe87a9..78eb3acf 100644 --- a/src/util/action_stack.cpp +++ b/src/util/action_stack.cpp @@ -28,8 +28,10 @@ ActionStack::~ActionStack() { void ActionStack::add(Action* action, bool allow_merge) { if (!action) return; // no action action->perform(false); // TODO: delete action if perform throws - redo_actions.clear(); tellListeners(*action, false); + // clear redo list + FOR_EACH(a, redo_actions) delete a; + redo_actions.clear(); // try to merge? if (allow_merge && !undo_actions.empty() && undo_actions.back()->merge(action)) { // merged with top undo action