Skip to content

Commit 766d29a

Browse files
committed
Allow threads to be re-attached
1 parent 7dd133f commit 766d29a

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

mono/mini/debugger-agent.c

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4222,8 +4222,11 @@ thread_startup (MonoProfiler *prof, uintptr_t tid)
42224222
}
42234223

42244224
tls = (DebuggerTlsData *)mono_native_tls_get_value (debugger_tls_id);
4225-
g_assert (!tls);
4226-
// FIXME: Free this somewhere
4225+
if (tls) {
4226+
if (!tls->terminated)
4227+
MONO_GC_UNREGISTER_ROOT (tls->thread);
4228+
g_free (tls);
4229+
}
42274230
tls = g_new0 (DebuggerTlsData, 1);
42284231
MONO_GC_REGISTER_ROOT_SINGLE (tls->thread, MONO_ROOT_SOURCE_DEBUGGER, NULL, "Debugger Thread Reference");
42294232
tls->thread = thread;

0 commit comments

Comments
 (0)