summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorSung Yoon Whang <suwhang@microsoft.com>2019-05-31 17:17:12 -0700
committerGitHub <noreply@github.com>2019-05-31 17:17:12 -0700
commit6d783b29087b5f260c9a64f347867bf6f6391bfe (patch)
tree97e372728100da1d3136927dd8a0864513e4b396 /src
parent436debb93c390e144f9c25b5d1922ac7780745f4 (diff)
downloadcoreclr-6d783b29087b5f260c9a64f347867bf6f6391bfe.tar.gz
coreclr-6d783b29087b5f260c9a64f347867bf6f6391bfe.tar.bz2
coreclr-6d783b29087b5f260c9a64f347867bf6f6391bfe.zip
Move EventPipeEventSource deletion to a better place (#24901)
* Move EventPipeEventSource deletion to a better place * typo
Diffstat (limited to 'src')
-rw-r--r--src/vm/eventpipe.cpp7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/vm/eventpipe.cpp b/src/vm/eventpipe.cpp
index dea3b1e493..0458be8854 100644
--- a/src/vm/eventpipe.cpp
+++ b/src/vm/eventpipe.cpp
@@ -259,6 +259,11 @@ void EventPipe::Shutdown()
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;
@@ -271,8 +276,6 @@ void EventPipe::Shutdown()
// Free resources.
delete pConfig;
delete pSessions;
- delete s_pEventSource;
- s_pEventSource = nullptr;
}
EventPipeSessionID EventPipe::Enable(