[threads] Make OSEvent alertable to fix bug #51653 (#4347)
[mono.git] / mono / metadata / icall.c
index 890e7155beeab41c07a6f82a18ab8b98f660c81b..4b56f40534580723c95cc798dbaf9b8d2e636d49 100644 (file)
@@ -6239,7 +6239,10 @@ ves_icall_System_Delegate_GetVirtualMethod_internal (MonoDelegate *delegate)
 {
        MonoReflectionMethod *ret = NULL;
        MonoError error;
-       ret = mono_method_get_object_checked (mono_domain_get (), mono_object_get_virtual_method (delegate->target, delegate->method), mono_object_class (delegate->target), &error);
+       MonoMethod *m;
+
+       m = mono_object_get_virtual_method (delegate->target, delegate->method);
+       ret = mono_method_get_object_checked (mono_domain_get (), m, m->klass, &error);
        mono_error_set_pending_exception (&error);
        return ret;
 }
@@ -6646,10 +6649,6 @@ ves_icall_System_Environment_Exit (int result)
        /* Suspend all managed threads since the runtime is going away */
        mono_thread_suspend_all_other_threads ();
 
-       //FIXME shutdown is, weirdly enough, abortible in gc.c so we add this hack for now, see https://bugzilla.xamarin.com/show_bug.cgi?id=51653
-       mono_threads_begin_abort_protected_block ();
-       mono_thread_info_clear_self_interrupt ();
-
        mono_runtime_quit ();
 #endif