Use g_module_build_path to resolve the shlib name

2008-08-21  Johan Dahlin  <johan@gnome.org>

    * girepository/gtypelib.c (_g_typelib_init):
    Use g_module_build_path to resolve the shlib name


svn path=/trunk/; revision=437
This commit is contained in:
Johan Dahlin 2008-08-21 14:21:00 +00:00 committed by Johan Dahlin
parent 3011ce4539
commit a47d659cd1

View File

@ -1836,6 +1836,8 @@ _g_typelib_init (GTypelib *typelib)
if (typelib->module == NULL)
{
gchar *resolved_shlib;
/* Glade's autoconnect feature and OpenGL's extension mechanism
* as used by Clutter rely on dlopen(NULL) to work as a means of
* accessing the app's symbols. This keeps us from using
@ -1845,10 +1847,13 @@ _g_typelib_init (GTypelib *typelib)
* load modules globally for now.
*/
typelib->module = g_module_open (shlib, G_MODULE_BIND_LAZY);
resolved_shlib = g_module_build_path (NULL, shlib);
typelib->module = g_module_open (resolved_shlib, G_MODULE_BIND_LAZY);
if (typelib->module == NULL)
g_warning ("Failed to load shared library referenced by the typelib: %s",
g_module_error ());
g_free (resolved_shlib);
}
}
}