Skip to content

Commit d38e2ad

Browse files
committed
Fix race condition with debugger on soft reboot
Signed-off-by: josesimoes <jose.simoes@eclo.solutions>
1 parent 41ba54b commit d38e2ad

File tree

2 files changed

+7
-0
lines changed

2 files changed

+7
-0
lines changed

src/CLR/Debugger/Debugger.cpp

+2
Original file line numberDiff line numberDiff line change
@@ -124,6 +124,8 @@ HRESULT CLR_DBG_Debugger::DeleteInstance()
124124
// free debugger
125125
platform_free(g_CLR_DBG_Debugger);
126126

127+
g_CLR_DBG_Debugger = NULL;
128+
127129
NANOCLR_NOCLEANUP_NOLABEL();
128130
}
129131

src/CLR/Messaging/Messaging.cpp

+5
Original file line numberDiff line numberDiff line change
@@ -391,6 +391,11 @@ bool CLR_Messaging::ProcessPayload( WP_Message* msg )
391391
// wrapper function for CLR_Messaging::ProcessPayload(
392392
extern "C" int CLR_Messaging_ProcessPayload(WP_Message* msg)
393393
{
394+
if (g_CLR_DBG_Debugger == NULL)
395+
{
396+
return false;
397+
}
398+
394399
bool retValue = g_CLR_DBG_Debugger->m_messaging->ProcessPayload(msg);
395400
return retValue;
396401
}

0 commit comments

Comments
 (0)