Fix module use tracking.

This commit is contained in:
Tomas Frydrych 2008-12-18 12:56:32 +00:00
parent 53cea00323
commit 0f73a011ce

View File

@ -247,6 +247,7 @@ mutter_plugin_manager_load (MutterPluginManager *plugin_mgr)
if (module) if (module)
{ {
MutterPlugin *p; MutterPlugin *p;
gboolean use_succeeded;
/* /*
* This dlopens the module and registers the plugin type with the * This dlopens the module and registers the plugin type with the
@ -255,7 +256,7 @@ mutter_plugin_manager_load (MutterPluginManager *plugin_mgr)
* to guarantee the module will not be unloaded during the plugin * to guarantee the module will not be unloaded during the plugin
* life time. Consequently we can unuse() the module again. * life time. Consequently we can unuse() the module again.
*/ */
g_type_module_use (G_TYPE_MODULE (module)); use_succeeded = g_type_module_use (G_TYPE_MODULE (module));
if ((p = mutter_plugin_load (plugin_mgr, module, params))) if ((p = mutter_plugin_load (plugin_mgr, module, params)))
{ {
@ -266,6 +267,7 @@ mutter_plugin_manager_load (MutterPluginManager *plugin_mgr)
g_warning ("Plugin load for [%s] failed", path); g_warning ("Plugin load for [%s] failed", path);
} }
if (use_succeeded)
g_type_module_unuse (G_TYPE_MODULE (module)); g_type_module_unuse (G_TYPE_MODULE (module));
} }
else else