diff options
Diffstat (limited to 'undo.h')
-rw-r--r-- | undo.h | 9 |
1 files changed, 7 insertions, 2 deletions
@@ -52,7 +52,9 @@ extern class UndoStack { SLIST_HEAD(undo_head, UndoToken) head; public: - UndoStack() + bool enabled; + + UndoStack(bool _enabled = true) : enabled(_enabled) { SLIST_INIT(&head); } @@ -61,7 +63,10 @@ public: inline void push(UndoToken *token) { - SLIST_INSERT_HEAD(&head, token, tokens); + if (enabled) + SLIST_INSERT_HEAD(&head, token, tokens); + else + delete token; } void push_msg(unsigned int iMessage, |