summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas Haller <thaller@redhat.com>2016-04-29 15:00:09 +0200
committerThomas Haller <thaller@redhat.com>2016-04-29 15:28:04 +0200
commit726f830c107fe57a05accd173658d56b4788ed19 (patch)
tree89d3118fb83d721b95a7a7a05535827e4dc51c45
parent726bb0f6bab49c5b5a27857063c4e2939f9c73ae (diff)
downloadNetworkManager-th/module-close.tar.gz
device: don't unload settings plugins on failureth/module-close
Also, registering a weak-pointer to close the module that was just made as resident is pointless.
-rw-r--r--src/settings/nm-settings.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/settings/nm-settings.c b/src/settings/nm-settings.c
index b91247a9ae..da0a59493e 100644
--- a/src/settings/nm-settings.c
+++ b/src/settings/nm-settings.c
@@ -847,18 +847,19 @@ load_plugin:
break;
}
+ /* after accessing the plugin we cannot unload it anymore, because the glib
+ * types cannot be properly unregistered. */
+ g_module_make_resident (plugin);
+
obj = (*factory_func) ();
if (!obj || !NM_IS_SETTINGS_PLUGIN (obj)) {
g_set_error (error, NM_SETTINGS_ERROR, NM_SETTINGS_ERROR_FAILED,
"Plugin '%s' returned invalid system config object.",
pname);
success = FALSE;
- g_module_close (plugin);
break;
}
- g_module_make_resident (plugin);
- g_object_weak_ref (obj, (GWeakNotify) g_module_close, plugin);
g_object_set_data_full (obj, PLUGIN_MODULE_PATH, path, g_free);
path = NULL;
if (add_plugin (self, NM_SETTINGS_PLUGIN (obj)))