Commit a1f1b13f authored by Beniamino Galvani's avatar Beniamino Galvani

settings: fix plugins loading

Since load_plugin() modifies the list, we must pass its address.

Fixes: fd86a1ae
parent bc28a2b1
......@@ -653,7 +653,7 @@ plugin_loaded (GSList *list, const char *path)
}
static gboolean
load_plugin (NMSettings *self, GSList *list, const char *pname, GError **error)
load_plugin (NMSettings *self, GSList **list, const char *pname, GError **error)
{
gs_free char *full_name = NULL;
gs_free char *path = NULL;
......@@ -666,7 +666,7 @@ load_plugin (NMSettings *self, GSList *list, const char *pname, GError **error)
full_name = g_strdup_printf ("nm-settings-plugin-%s", pname);
path = g_module_build_path (NMPLUGINDIR, full_name);
if (plugin_loaded (list, path))
if (plugin_loaded (*list, path))
return TRUE;
if (stat (path, &st) != 0) {
......@@ -719,7 +719,7 @@ load_plugin (NMSettings *self, GSList *list, const char *pname, GError **error)
g_object_set_qdata_full (obj, plugin_module_path_quark (), path, g_free);
path = NULL;
if (add_plugin (self, NM_SETTINGS_PLUGIN (obj)))
list = g_slist_append (list, g_steal_pointer (&obj));
*list = g_slist_append (*list, g_steal_pointer (&obj));
return TRUE;
}
......@@ -787,7 +787,7 @@ load_plugins (NMSettings *self, const char **plugins, GError **error)
continue;
}
success = load_plugin (self, list, pname, error);
success = load_plugin (self, &list, pname, error);
if (!success)
break;
......@@ -797,7 +797,7 @@ load_plugins (NMSettings *self, const char **plugins, GError **error)
pname = "ibft";
add_ibft = FALSE;
success = load_plugin (self, list, "ibft", error);
success = load_plugin (self, &list, "ibft", error);
if (!success)
break;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment