Commit eb505a3c authored by twanvl's avatar twanvl

fixed memory leak

parent 2b333fc9
......@@ -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
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment