summaryrefslogtreecommitdiff
path: root/src/gpm-statistics.c
diff options
context:
space:
mode:
authorraveit65 <[email protected]>2019-09-24 19:49:05 +0200
committerraveit65 <[email protected]>2019-09-26 11:08:59 +0200
commit9d5b257f74d396ad4ed3d144185ab95b318b03b8 (patch)
tree3f0a85eed9fc9651892f016f98b73f006ad94330 /src/gpm-statistics.c
parent718962729f58c7acbc2b5b3427c2de8909669eee (diff)
downloadmate-power-manager-9d5b257f74d396ad4ed3d144185ab95b318b03b8.tar.bz2
mate-power-manager-9d5b257f74d396ad4ed3d144185ab95b318b03b8.tar.xz
Use up_client_get_devices2()
The previous code would have leaked all the UpDevice objects because no free function was set on the returned GPtrArray. With depending on upower-glib 0.99.8 get_devices() was deprecated and get_devices2() was introduced, we can simply switch to get_devices2() which does set a free function on the returned GPtrArray, stopping the leak. Inspired from: https://gitlab.gnome.org/GNOME/gnome-control-center/commit/c1210c5 see upower upstream: https://gitlab.freedesktop.org/upower/upower/commit/cb1071b
Diffstat (limited to 'src/gpm-statistics.c')
-rw-r--r--src/gpm-statistics.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/gpm-statistics.c b/src/gpm-statistics.c
index fc302a4..34541f6 100644
--- a/src/gpm-statistics.c
+++ b/src/gpm-statistics.c
@@ -1796,7 +1796,7 @@ main (int argc, char *argv[])
if (!ret)
goto out;
#endif
- devices = up_client_get_devices (client);
+ devices = up_client_get_devices2 (client);
/* add devices in visually pleasing order */
for (j=0; j<UP_DEVICE_KIND_LAST; j++) {