From 5e2204b27c8a45a9600a870d741dc9ace44a659d Mon Sep 17 00:00:00 2001 From: Sebastian Reimers Date: Wed, 27 Sep 2023 18:25:39 +0200 Subject: [PATCH] set trace.init false before deref --- src/trace/trace.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/trace/trace.c b/src/trace/trace.c index ec81a04e2..bf9641f79 100644 --- a/src/trace/trace.c +++ b/src/trace/trace.c @@ -199,14 +199,14 @@ int re_trace_close(void) #ifndef RE_TRACE_ENABLED return 0; #endif - tmr_cancel(&trace.flush_tmr); + tmr_cancel(&trace.flush_tmr); re_trace_flush(); + re_atomic_rlx_set(&trace.init, false); trace.event_buffer = mem_deref(trace.event_buffer); trace.event_buffer_flush = mem_deref(trace.event_buffer_flush); mtx_destroy(&trace.lock); - re_atomic_rlx_set(&trace.init, false); (void)re_fprintf(trace.f, "\n\t]\n}\n"); if (trace.f)