summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBastien Nocera <hadess@hadess.net>2014-06-24 16:41:48 +0200
committerBastien Nocera <hadess@hadess.net>2014-06-24 16:41:48 +0200
commitbab2431c1e7406860179267faa54f35ad82131fe (patch)
tree2a78f500c4eee1d9f388b973ced874413357a4ab
parentdbb9bead6d3b9e70a5d58019b1615d2a6fba5312 (diff)
downloadupower-bab2431c1e7406860179267faa54f35ad82131fe.tar.gz
linux: Simplify list freeing
-rw-r--r--src/linux/up-backend.c3
-rw-r--r--src/linux/up-device-unifying.c3
2 files changed, 2 insertions, 4 deletions
diff --git a/src/linux/up-backend.c b/src/linux/up-backend.c
index 5e2b846..9f4d033 100644
--- a/src/linux/up-backend.c
+++ b/src/linux/up-backend.c
@@ -334,8 +334,7 @@ up_backend_coldplug (UpBackend *backend, UpDaemon *daemon)
native = l->data;
up_backend_device_add (backend, native);
}
- g_list_foreach (devices, (GFunc) g_object_unref, NULL);
- g_list_free (devices);
+ g_list_free_full (devices, (GDestroyNotify) g_object_unref);
}
return TRUE;
diff --git a/src/linux/up-device-unifying.c b/src/linux/up-device-unifying.c
index 1819a8a..7d0dbf9 100644
--- a/src/linux/up-device-unifying.c
+++ b/src/linux/up-device-unifying.c
@@ -289,8 +289,7 @@ up_device_unifying_coldplug (UpDevice *device)
up_daemon_start_poll (G_OBJECT (device), (GSourceFunc) up_device_unifying_refresh);
ret = TRUE;
out:
- g_list_foreach (hidraw_list, (GFunc) g_object_unref, NULL);
- g_list_free (hidraw_list);
+ g_list_free_full (hidraw_list, (GDestroyNotify) g_object_unref);
if (parent != NULL)
g_object_unref (parent);
if (receiver != NULL)