X-Git-Url: https://www.fi.muni.cz/~kas/git//home/kas/public_html/git/?a=blobdiff_plain;f=libdocument%2Fev-module.c;h=65627ab1643ab09c68e4082c2a1c35d662ce3560;hb=776a6fe02961d8901d21e172633d3c8d1c85dc93;hp=f2aebe702c9d3d5d934e9749f71a6c0adac35b6f;hpb=31e16bd8f386dc292e60489d4a17227804bdc2e6;p=evince.git diff --git a/libdocument/ev-module.c b/libdocument/ev-module.c index f2aebe70..65627ab1 100644 --- a/libdocument/ev-module.c +++ b/libdocument/ev-module.c @@ -54,6 +54,7 @@ struct _EvModule { GTypeModule parent_instance; GModule *library; + gboolean resident; gchar *path; GType type; @@ -75,7 +76,7 @@ ev_module_load (GTypeModule *gmodule) module->library = g_module_open (module->path, 0); if (!module->library) { - g_warning (g_module_error ()); + g_warning ("%s", g_module_error ()); return FALSE; } @@ -83,7 +84,7 @@ ev_module_load (GTypeModule *gmodule) /* extract symbols from the lib */ if (!g_module_symbol (module->library, "register_evince_backend", (void *) ®ister_func)) { - g_warning (g_module_error ()); + g_warning ("%s", g_module_error ()); g_module_close (module->library); return FALSE; @@ -106,6 +107,9 @@ ev_module_load (GTypeModule *gmodule) return FALSE; } + if (module->resident) + g_module_make_resident (module->library); + return TRUE; } @@ -175,7 +179,8 @@ ev_module_class_init (EvModuleClass *class) } EvModule * -ev_module_new (const gchar *path) +ev_module_new (const gchar *path, + gboolean resident) { EvModule *result; @@ -185,6 +190,7 @@ ev_module_new (const gchar *path) g_type_module_set_name (G_TYPE_MODULE (result), path); result->path = g_strdup (path); + result->resident = resident; return result; }