Skip to content

Commit

Permalink
Allow threads to be re-attached
Browse files Browse the repository at this point in the history
  • Loading branch information
joncham committed Apr 30, 2021
1 parent 7dd133f commit 766d29a
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions mono/mini/debugger-agent.c
Original file line number Diff line number Diff line change
Expand Up @@ -4222,8 +4222,11 @@ thread_startup (MonoProfiler *prof, uintptr_t tid)
}

tls = (DebuggerTlsData *)mono_native_tls_get_value (debugger_tls_id);
g_assert (!tls);
// FIXME: Free this somewhere
if (tls) {
if (!tls->terminated)
MONO_GC_UNREGISTER_ROOT (tls->thread);
g_free (tls);
}
tls = g_new0 (DebuggerTlsData, 1);
MONO_GC_REGISTER_ROOT_SINGLE (tls->thread, MONO_ROOT_SOURCE_DEBUGGER, NULL, "Debugger Thread Reference");
tls->thread = thread;
Expand Down

0 comments on commit 766d29a

Please sign in to comment.