Make undo/redo work for:
[ardour.git] / libs / pbd / undo.cc
index 42f7d574ea4030f44f486215901dedba64c0af25..2da9c7214d78084d905894c3e85a6ff897880ed9 100644 (file)
@@ -220,6 +220,13 @@ UndoHistory::add (UndoTransaction* const ut)
        }
 
        UndoList.push_back (ut);
+       /* Adding a transacrion means that redo is meaningless from this point. */
+       _clearing = true;
+       for (std::list<UndoTransaction*>::iterator i = RedoList.begin(); i != RedoList.end(); ++i) {
+                delete *i;
+        }
+       RedoList.clear ();
+       _clearing = false;
 
        /* we are now owners of the transaction and must delete it when finished with it */