diff --git a/thread.c b/thread.c index 69fc299..7312184 100644 --- a/thread.c +++ b/thread.c @@ -4084,6 +4084,7 @@ set_trace_func(VALUE obj, VALUE trace) rb_remove_event_hook(call_trace_func); if (NIL_P(trace)) { + GET_THREAD()->tracing = EVENT_RUNNING_NOTHING; return Qnil; } @@ -4140,6 +4141,7 @@ thread_set_trace_func_m(VALUE obj, VALUE trace) rb_threadptr_remove_event_hook(th, call_trace_func); if (NIL_P(trace)) { + th->tracing = EVENT_RUNNING_NOTHING; return Qnil; } thread_add_trace_func(th, trace);