Extend the mixed-dependency check to modules as well
This helps prevent accidents with GTK_PATH.
This commit is contained in:
@ -237,7 +237,16 @@ find_module (const gchar *name)
|
||||
}
|
||||
|
||||
module = g_module_open (module_name, G_MODULE_BIND_LOCAL | G_MODULE_BIND_LAZY);
|
||||
g_free(module_name);
|
||||
|
||||
if (_gtk_module_has_mixed_deps (module))
|
||||
{
|
||||
g_warning ("GTK+ module %s cannot be loaded.\n"
|
||||
"GTK+ 2.x symbols detected. Using GTK+ 2.x and GTK+ 3 in the same process is not supported.", module_name);
|
||||
g_module_close (module);
|
||||
module = NULL;
|
||||
}
|
||||
|
||||
g_free (module_name);
|
||||
|
||||
return module;
|
||||
}
|
||||
@ -354,8 +363,13 @@ load_module (GSList *module_list,
|
||||
}
|
||||
}
|
||||
else
|
||||
g_message ("Failed to load module \"%s\": %s", name, g_module_error ());
|
||||
|
||||
{
|
||||
const gchar *error = g_module_error ();
|
||||
|
||||
g_message ("Failed to load module \"%s\"%s%s",
|
||||
name, error ? ": " : "", error ? error : "");
|
||||
}
|
||||
|
||||
return module_list;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user