mirror of
https://gitlab.freedesktop.org/NetworkManager/NetworkManager.git
synced 2026-05-06 03:28:03 +02:00
settings: don't unload settings plugins on failure
Also, registering a weak-pointer to close the module that
was just made as resident is pointless.
(cherry picked from commit c6a92224a4)
This commit is contained in:
parent
3497dce786
commit
97c15ed358
1 changed files with 4 additions and 3 deletions
|
|
@ -843,18 +843,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)))
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue