Skip to content

Commit

Permalink
set trace.init false before deref
Browse files Browse the repository at this point in the history
  • Loading branch information
sreimers committed Sep 28, 2023
1 parent 0cfecdb commit 5e2204b
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/trace/trace.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 5e2204b

Please sign in to comment.