aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/undo.h
diff options
context:
space:
mode:
authorRobin Haberkorn <robin.haberkorn@googlemail.com>2025-03-21 13:26:01 +0300
committerRobin Haberkorn <robin.haberkorn@googlemail.com>2025-03-21 13:40:52 +0300
commit33f71654136014bac094babaaa81d91245fdd24c (patch)
tree2090722fc330ded11fb00321a8afd7e0e81bafaa /src/undo.h
parent121cca61bedf24ba428e019f23b3bbb7160ce162 (diff)
downloadsciteco-33f71654136014bac094babaaa81d91245fdd24c.tar.gz
fixed rubout of Q-Register specifications
* This was a regression introduced by 257a0bf128e109442dce91c4aaa1d97fed17ad1a. * The undo token that frees newly allocated teco_machine_qregspec_t must actually reset the pointer as well since any subsequent token, pushed by teco_undo_qregspec_own(), will expect a valid pointer. * Could have been done via ctx->expectqreg = NULL; teco_undo_qregspec_own(ctx->expectqreg); but using a special clear function requires less memory and is easier to understand. * Added test case. This wouldn't always crash, but should definitely show up in Valgrind.
Diffstat (limited to 'src/undo.h')
-rw-r--r--src/undo.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/src/undo.h b/src/undo.h
index 6fbb1c1..459fdb0 100644
--- a/src/undo.h
+++ b/src/undo.h
@@ -143,6 +143,7 @@ gpointer teco_undo_push_size(teco_undo_action_t action_cb, gsize size)
* At undo-time however, it is expected to be valid.
* Therefore it is crucial to set the variable afterwards or at least to nullify it.
* The DELETE function may consequently have to deal with NULL pointers.
+ * Also, any other undo action must always leave the variable in a valid state.
*
* @ingroup undo_objects
*/