diff options
author | Ludovic Henry <ludovic@xamarin.com> | 2018-03-23 23:00:39 +0300 |
---|---|---|
committer | Marek Safar <marek.safar@gmail.com> | 2018-03-26 19:01:42 +0300 |
commit | bf27e2544662ab34e1d50f1d43ea96ee2502c685 (patch) | |
tree | 8f60a8cd21631973871c6ee3232d8aaa0e052bab | |
parent | 4e276971c0c7408a351294d38f857a1322ec3da2 (diff) |
Remove suspicious mono_gchandle_freemono-5.10.1.16
Fixes https://github.com/mono/mono/issues/7786
-rw-r--r-- | mono/metadata/threads.c | 3 | ||||
-rw-r--r-- | mono/utils/mono-threads.c | 3 |
2 files changed, 4 insertions, 2 deletions
diff --git a/mono/metadata/threads.c b/mono/metadata/threads.c index 5bca4f0ab73..e5ab853cd3c 100644 --- a/mono/metadata/threads.c +++ b/mono/metadata/threads.c @@ -3008,6 +3008,7 @@ thread_detach (MonoThreadInfo *info) * the thread */ g_assert (info); + g_assert (mono_thread_info_is_current (info)); if (!mono_thread_info_try_get_internal_thread_gchandle (info, &gchandle)) return; @@ -3015,8 +3016,6 @@ thread_detach (MonoThreadInfo *info) internal = (MonoInternalThread*) mono_gchandle_get_target (gchandle); g_assert (internal); - mono_gchandle_free (gchandle); - mono_thread_detach_internal (internal); } diff --git a/mono/utils/mono-threads.c b/mono/utils/mono-threads.c index d41724d7a6f..4e77d0d5582 100644 --- a/mono/utils/mono-threads.c +++ b/mono/utils/mono-threads.c @@ -685,6 +685,7 @@ gboolean mono_thread_info_try_get_internal_thread_gchandle (MonoThreadInfo *info, guint32 *gchandle) { g_assert (info); + g_assert (mono_thread_info_is_current (info)); if (info->internal_thread_gchandle == G_MAXUINT32) return FALSE; @@ -697,6 +698,7 @@ void mono_thread_info_set_internal_thread_gchandle (MonoThreadInfo *info, guint32 gchandle) { g_assert (info); + g_assert (mono_thread_info_is_current (info)); g_assert (gchandle != G_MAXUINT32); info->internal_thread_gchandle = gchandle; } @@ -705,6 +707,7 @@ void mono_thread_info_unset_internal_thread_gchandle (THREAD_INFO_TYPE *info) { g_assert (info); + g_assert (mono_thread_info_is_current (info)); info->internal_thread_gchandle = G_MAXUINT32; } |