[runtime] Make sure to switch to GC SAFE before calling xamarin_switch_gchandle.

This commit is contained in:
Rolf Bjarne Kvinge 2016-05-18 11:14:10 +02:00
Родитель ac8d493581
Коммит 13b7c6dd11
1 изменённых файлов: 4 добавлений и 1 удалений

Просмотреть файл

@ -682,8 +682,11 @@ gc_register_toggleref (MonoObject *obj, id self, bool isCustomType)
mono_gc_toggleref_add (obj, TRUE); mono_gc_toggleref_add (obj, TRUE);
// Make sure the GCHandle we have is a weak one for custom types. // Make sure the GCHandle we have is a weak one for custom types.
if (isCustomType) if (isCustomType) {
MONO_BEGIN_GC_SAFE;
xamarin_switch_gchandle (self, true); xamarin_switch_gchandle (self, true);
MONO_END_GC_SAFE;
}
} }
static MonoToggleRefStatus static MonoToggleRefStatus