diff --git a/src/native/eventpipe/ep-session.c b/src/native/eventpipe/ep-session.c index 60a5fe0cb2583..dc3a259cae28e 100644 --- a/src/native/eventpipe/ep-session.c +++ b/src/native/eventpipe/ep-session.c @@ -68,11 +68,10 @@ EP_RT_DEFINE_THREAD_FUNC (streaming_thread) ep_rt_thread_sleep (timeout_ns); } + session->streaming_thread = NULL; ep_rt_wait_event_set (&session->rt_thread_shutdown_event); EP_GCX_PREEMP_EXIT - session->streaming_thread = NULL; - if (!success) ep_disable ((EventPipeSessionID)session);