aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/qreg.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/qreg.c')
-rw-r--r--src/qreg.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/src/qreg.c b/src/qreg.c
index 1b97689..39406a2 100644
--- a/src/qreg.c
+++ b/src/qreg.c
@@ -1715,5 +1715,12 @@ teco_machine_qregspec_free(teco_machine_qregspec_t *ctx)
g_free(ctx);
}
-TECO_DEFINE_UNDO_CALL(teco_machine_qregspec_free, teco_machine_qregspec_t *);
+static inline void
+teco_machine_qregspec_clear(teco_machine_qregspec_t **ctx)
+{
+ teco_machine_qregspec_free(*ctx);
+ *ctx = NULL;
+}
+
+TECO_DEFINE_UNDO_CALL(teco_machine_qregspec_clear, teco_machine_qregspec_t **);
TECO_DEFINE_UNDO_OBJECT_OWN(qregspec, teco_machine_qregspec_t *, teco_machine_qregspec_free);