Skip to content

Commit 3191b8a

Browse files
author
brianradunity
authored
Merge pull request #787 from Unity-Technologies/il2cpp-debugger-misc-bug-fixes
Make breakpoints_cleanup() safe to call multiple times
2 parents 3207b33 + 88d2f08 commit 3191b8a

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)