From 0f73a011ce4983f24824c6aa5cdc9774beeb057e Mon Sep 17 00:00:00 2001 From: Tomas Frydrych Date: Thu, 18 Dec 2008 12:56:32 +0000 Subject: [PATCH] Fix module use tracking. --- src/compositor/mutter/mutter-plugin-manager.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/compositor/mutter/mutter-plugin-manager.c b/src/compositor/mutter/mutter-plugin-manager.c index 4d89dbba8..c17eae2cf 100644 --- a/src/compositor/mutter/mutter-plugin-manager.c +++ b/src/compositor/mutter/mutter-plugin-manager.c @@ -247,6 +247,7 @@ mutter_plugin_manager_load (MutterPluginManager *plugin_mgr) if (module) { MutterPlugin *p; + gboolean use_succeeded; /* * 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 * 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))) { @@ -266,7 +267,8 @@ mutter_plugin_manager_load (MutterPluginManager *plugin_mgr) g_warning ("Plugin load for [%s] failed", path); } - g_type_module_unuse (G_TYPE_MODULE (module)); + if (use_succeeded) + g_type_module_unuse (G_TYPE_MODULE (module)); } else g_warning ("Unable to load plugin module [%s]: %s",