diff options
Diffstat (limited to 'src/undo.cpp')
-rw-r--r-- | src/undo.cpp | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/src/undo.cpp b/src/undo.cpp index b6c510c..e189e23 100644 --- a/src/undo.cpp +++ b/src/undo.cpp @@ -67,10 +67,12 @@ UndoStack::set_memory_limit(gsize new_limit) void UndoStack::push(UndoToken *token) { - if (!enabled) { - delete token; - return; - } + /* + * All undo token allocations should take place using the + * variadic template version of UndoStack::push(), so we + * don't have to check `enabled` here. + */ + g_assert(enabled == true); if (memory_limit) { gsize token_size = token->get_size(); |