From 9d5b257f74d396ad4ed3d144185ab95b318b03b8 Mon Sep 17 00:00:00 2001 From: raveit65 Date: Tue, 24 Sep 2019 19:49:05 +0200 Subject: 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 --- src/gpm-statistics.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/gpm-statistics.c') 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