diff --git a/src/native/eventpipe/ep-session.c b/src/native/eventpipe/ep-session.c index 2f8a55b20b0fbc..973b20350448c4 100644 --- a/src/native/eventpipe/ep-session.c +++ b/src/native/eventpipe/ep-session.c @@ -71,11 +71,11 @@ EP_RT_DEFINE_THREAD_FUNC (streaming_thread) ep_rt_wait_event_set (&session->rt_thread_shutdown_event); EP_GCX_PREEMP_EXIT + session->streaming_thread = NULL; + if (!success) ep_disable ((EventPipeSessionID)session); - session->streaming_thread = NULL; - return (ep_rt_thread_start_func_return_t)0; }