提交 48d3c2a2 编写于 作者: S Sung Yoon Whang 提交者: GitHub

Move EventPipeEventSource deletion to a better place (dotnet/coreclr#24901)

* Move EventPipeEventSource deletion to a better place

* typo


Commit migrated from https://github.com/dotnet/coreclr/commit/6d783b29087b5f260c9a64f347867bf6f6391bfe
上级 a123fb2c
...@@ -259,6 +259,11 @@ void EventPipe::Shutdown() ...@@ -259,6 +259,11 @@ void EventPipe::Shutdown()
EX_CATCH {} EX_CATCH {}
EX_END_CATCH(SwallowAllExceptions); 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; EventPipeConfiguration *pConfig = s_pConfig;
EventPipeSessions *pSessions = s_pSessions; EventPipeSessions *pSessions = s_pSessions;
...@@ -271,8 +276,6 @@ void EventPipe::Shutdown() ...@@ -271,8 +276,6 @@ void EventPipe::Shutdown()
// Free resources. // Free resources.
delete pConfig; delete pConfig;
delete pSessions; delete pSessions;
delete s_pEventSource;
s_pEventSource = nullptr;
} }
EventPipeSessionID EventPipe::Enable( EventPipeSessionID EventPipe::Enable(
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册