--- a/gplugin-gtk/gplugin-gtk-store.c Sun Feb 23 04:37:17 2020 +0000
+++ b/gplugin-gtk/gplugin-gtk-store.c Sun Feb 23 05:33:06 2020 +0000
@@ -107,7 +107,7 @@
plugins = gplugin_manager_find_plugins(id);
for(l = plugins; l; l = l->next)
gplugin_gtk_store_add_plugin(store, GPLUGIN_PLUGIN(l->data));
- gplugin_manager_free_plugin_list(plugins);
+ g_slist_free_full(plugins, g_object_unref); --- a/gplugin/gplugin-manager.c Sun Feb 23 04:37:17 2020 +0000
+++ b/gplugin/gplugin-manager.c Sun Feb 23 05:33:06 2020 +0000
@@ -628,7 +628,7 @@
- gplugin_manager_free_plugin_list(dependencies);
+ g_slist_free_full(dependencies, g_object_unref); @@ -686,7 +686,7 @@
/* prepend the first found match to our return value */
ret = g_slist_prepend(ret, g_object_ref(matches->data));
- gplugin_manager_free_plugin_list(matches);
+ g_slist_free_full(matches, g_object_unref); @@ -699,7 +699,7 @@
_("failed to find dependency %s for %s"),
dependencies[i], gplugin_plugin_info_get_id(info));
- gplugin_manager_free_plugin_list(ret);
+ g_slist_free_full(ret, g_object_unref); g_object_unref(G_OBJECT(info));
@@ -1259,8 +1259,8 @@
* Returns: (element-type GPlugin.Plugin) (transfer full): A #GSList of
* referenced #GPluginPlugin's matching @id. Call
- * gplugin_manager_free_plugin_list() on the returned value when
+ * g_slist_free_full() with a `DestroyNotify` of g_object_unref() on + * the returned value when you're done with it. gplugin_manager_find_plugins(const gchar *id) {
@@ -1289,8 +1289,8 @@
* Returns: (element-type GPlugin.Plugin) (transfer full): A #GSList of
* referenced #GPluginPlugin's matching @id. Call
- * gplugin_manager_free_plugin_list() on the returned value when
+ * g_slist_free_full() with a `DestroyNotify` of g_object_unref() on + * the returned value when you're done with it. gplugin_manager_find_plugins_with_version(const gchar *id, const gchar *op,
@@ -1361,37 +1361,12 @@
- gplugin_manager_free_plugin_list(plugins);
+ g_slist_free_full(plugins, g_object_unref); return g_slist_reverse(filtered);
- * gplugin_manager_free_plugin_list:
- * @plugins_list: (element-type GPlugin.Plugin) (nullable): Returned value from
- * plugin_manager_find_plugins().
- * Frees the returned value of gplugin_manager_find_plugins().
-gplugin_manager_free_plugin_list(GSList *plugins_list) {
- for(l = plugins_list; l; l = l->next) {
- GPluginPlugin *plugin = NULL;
- plugin = GPLUGIN_PLUGIN(l->data);
- g_object_unref(G_OBJECT(plugin));
- g_slist_free(plugins_list);
* gplugin_manager_find_plugin:
* @id: The id of the plugin to find.
@@ -1415,7 +1390,7 @@
plugin = GPLUGIN_PLUGIN(g_object_ref(G_OBJECT(plugins_list->data)));
- gplugin_manager_free_plugin_list(plugins_list);
+ g_slist_free_full(plugins_list, g_object_unref); @@ -1429,8 +1404,9 @@
* Return value: (element-type GPlugin.Plugin) (transfer full): A #GSList of
* #GPluginPlugin's that @plugin depends on, or %NULL on error
- * with @error set. Call #gplugin_manager_free_plugin_list on
- * the returned value when you're done with it.
+ * with @error set. Call g_slist_free_full() with a + * `DestroyNotify` of g_object_unref() on the returned value when gplugin_manager_get_plugin_dependencies(GPluginPlugin *plugin, GError **error) {
--- a/gplugin/gplugin-manager.h Sun Feb 23 04:37:17 2020 +0000
+++ b/gplugin/gplugin-manager.h Sun Feb 23 05:33:06 2020 +0000
@@ -46,7 +46,6 @@
GSList *gplugin_manager_find_plugins(const gchar *id);
GSList *gplugin_manager_find_plugins_with_version(const gchar *id, const gchar *op, const gchar *version);
-void gplugin_manager_free_plugin_list(GSList *plugins_list);
GPluginPlugin *gplugin_manager_find_plugin(const gchar *id);
--- a/gplugin/gplugin-query.c Sun Feb 23 04:37:17 2020 +0000
+++ b/gplugin/gplugin-query.c Sun Feb 23 05:33:06 2020 +0000
@@ -219,7 +219,7 @@
- gplugin_manager_free_plugin_list(plugins);
+ g_slist_free_full(plugins, g_object_unref); --- a/gplugin/tests/test-id-collision.c Sun Feb 23 04:37:17 2020 +0000
+++ b/gplugin/tests/test-id-collision.c Sun Feb 23 05:33:06 2020 +0000
@@ -39,7 +39,7 @@
g_assert_cmpuint(g_slist_length(plugins), ==, 2);
- gplugin_manager_free_plugin_list(plugins);
+ g_slist_free_full(plugins, g_object_unref); /******************************************************************************