diff --git a/thread.c b/thread.c index 4022f60..98ad9af 100644 --- a/thread.c +++ b/thread.c @@ -3933,6 +3933,7 @@ set_trace_func(VALUE obj, VALUE trace) rb_remove_event_hook(call_trace_func); if (NIL_P(trace)) { + GET_THREAD()->tracing = 0; return Qnil; } @@ -3989,6 +3990,7 @@ thread_set_trace_func_m(VALUE obj, VALUE trace) rb_threadptr_revmove_event_hook(th, call_trace_func); if (NIL_P(trace)) { + th->tracing = 0; return Qnil; } thread_add_trace_func(th, trace);