Skip to content

Commit 88d2f08

Browse files
author
Brian Raderman
committed
breakpoints_cleanup() in the debugger agent can be called multiple
times when used with IL2CPP, so added some defense against this to prevent already-cleared hashtables and arrays from being destroyed multiple times.
1 parent acc623a commit 88d2f08

File tree

1 file changed

+14
-8
lines changed

1 file changed

+14
-8
lines changed

mono/mini/debugger-agent.c

Lines changed: 14 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -4930,14 +4930,20 @@ breakpoints_cleanup (void)
49304930
}
49314931
}
49324932

4933-
for (i = 0; i < breakpoints->len; ++i)
4934-
g_free (g_ptr_array_index (breakpoints, i));
4935-
4936-
g_ptr_array_free (breakpoints, TRUE);
4937-
g_hash_table_destroy (bp_locs);
4938-
4939-
breakpoints = NULL;
4940-
bp_locs = NULL;
4933+
if (breakpoints)
4934+
{
4935+
for (i = 0; i < breakpoints->len; ++i)
4936+
g_free (g_ptr_array_index (breakpoints, i));
4937+
4938+
g_ptr_array_free (breakpoints, TRUE);
4939+
breakpoints = NULL;
4940+
}
4941+
4942+
if (bp_locs)
4943+
{
4944+
g_hash_table_destroy (bp_locs);
4945+
bp_locs = NULL;
4946+
}
49414947

49424948
mono_loader_unlock ();
49434949
}

0 commit comments

Comments
 (0)