avoid a set of calls to gettext() and/or cousins from global constructor scope
[ardour.git] / libs / pbd / undo.cc
index 120f62c3512c78d263ae48a3aa6e9990b6eea30b..42f7d574ea4030f44f486215901dedba64c0af25 100644 (file)
@@ -18,7 +18,6 @@
     $Id$
 */
 
-#include <iostream>
 #include <string>
 #include <sstream>
 #include <time.h>
@@ -41,6 +40,7 @@ UndoTransaction::UndoTransaction (const UndoTransaction& rhs)
        : Command(rhs._name)
        , _clearing(false)
 {
+        _timestamp = rhs._timestamp;
        clear ();
        actions.insert(actions.end(),rhs.actions.begin(),rhs.actions.end());
 }
@@ -294,6 +294,9 @@ void
 UndoHistory::clear_redo ()
 {
        _clearing = true;
+        for (std::list<UndoTransaction*>::iterator i = RedoList.begin(); i != RedoList.end(); ++i) {
+                delete *i;
+        }
        RedoList.clear ();
        _clearing = false;
 
@@ -305,6 +308,9 @@ void
 UndoHistory::clear_undo ()
 {
        _clearing = true;
+        for (std::list<UndoTransaction*>::iterator i = UndoList.begin(); i != UndoList.end(); ++i) {
+                delete *i;
+        }
        UndoList.clear ();
        _clearing = false;