[runtime] Make sure to switch to GC SAFE before calling xamarin_switch_gchandle.
This commit is contained in:
Родитель
ac8d493581
Коммит
13b7c6dd11
|
@ -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
|
||||||
|
|
Загрузка…
Ссылка в новой задаче