2009-01-13 Zoltan Varga <vargaz@gmail.com>
[mono.git] / mono / metadata / marshal.c
index 18504565648ddafed7ae8b002a87d8464e22770c..6d321f9f6a4b48e498b439ab808c203111c97696 100644 (file)
@@ -9871,6 +9871,8 @@ mono_marshal_get_synchronized_wrapper (MonoMethod *method)
        mono_loader_unlock ();
        clause->flags = MONO_EXCEPTION_CLAUSE_FINALLY;
 
+       mono_loader_lock ();
+
        if (!enter_method) {
                MonoMethodDesc *desc;
 
@@ -9890,6 +9892,8 @@ mono_marshal_get_synchronized_wrapper (MonoMethod *method)
                mono_method_desc_free (desc);
        }
 
+       mono_loader_unlock ();
+
        /* Push this or the type object */
        if (method->flags & METHOD_ATTRIBUTE_STATIC) {
                /* We have special handling for this in the JIT */
@@ -10744,6 +10748,8 @@ ves_icall_System_Runtime_InteropServices_Marshal_GetIUnknownForObjectInternal (M
        if (!object)
                return NULL;
 
+       mono_init_com_types ();
+
        if (cominterop_object_is_rcw (object)) {
                MonoClass *klass = NULL;
                MonoRealProxy* real_proxy = NULL;
@@ -10804,6 +10810,8 @@ void*
 ves_icall_System_Runtime_InteropServices_Marshal_GetIDispatchForObjectInternal (MonoObject* object)
 {
 #ifndef DISABLE_COM
+       mono_init_com_types ();
+
        return cominterop_get_idispatch_for_object (object);
 #else
        g_assert_not_reached ();