提交 3d22da0f 编写于 作者: Z Zoltan Varga

[runtime] Avoid an assert if a runtime compiled without DISABLE_COM is used...

[runtime] Avoid an assert if a runtime compiled without DISABLE_COM is used with an mscorlib from the mobile_static profile.
上级 c52c794b
......@@ -170,6 +170,22 @@ mono_marshal_safearray_set_value (gpointer safearray, gpointer indices, gpointer
static void
mono_marshal_safearray_free_indices (gpointer indices);
MonoClass*
mono_class_try_get_com_object_class (void)
{
static MonoClass *tmp_class;
static gboolean inited;
MonoClass *klass;
if (!inited) {
klass = mono_class_from_name (mono_defaults.corlib, "System", "__ComObject");
mono_memory_barrier ();
tmp_class = klass;
mono_memory_barrier ();
inited = TRUE;
}
return tmp_class;
}
/**
* cominterop_method_signature:
* @method: a method
......
......@@ -53,4 +53,7 @@ mono_string_from_bstr (gpointer bstr);
MONO_API void
mono_free_bstr (gpointer bstr);
MonoClass*
mono_class_try_get_com_object_class (void);
#endif /* __MONO_COMINTEROP_H__ */
......@@ -408,7 +408,7 @@ mono_marshal_get_remoting_invoke (MonoMethod *method)
/* this seems to be the best plase to put this, as all remoting invokes seem to get filtered through here */
#ifndef DISABLE_COM
if (mono_class_is_com_object (method->klass) || method->klass == mono_class_get_com_object_class ()) {
if (mono_class_is_com_object (method->klass) || method->klass == mono_class_try_get_com_object_class ()) {
MonoVTable *vtable = mono_class_vtable (mono_domain_get (), method->klass);
g_assert (vtable); /*FIXME do proper error handling*/
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册