* Move EventPipeEventSource deletion to a better place
* typo
EX_CATCH {}
EX_END_CATCH(SwallowAllExceptions);
+ // Remove EventPipeEventSource first since it tries to use the data structures that we remove below.
+ // We need to do this after disabling sessions since those try to write to EventPipeEventSource.
+ delete s_pEventSource;
+ s_pEventSource = nullptr;
+
EventPipeConfiguration *pConfig = s_pConfig;
EventPipeSessions *pSessions = s_pSessions;
// Free resources.
delete pConfig;
delete pSessions;
- delete s_pEventSource;
- s_pEventSource = nullptr;
}
EventPipeSessionID EventPipe::Enable(