summaryrefslogtreecommitdiff
path: root/src/gpm-engine.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-engine.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-engine.c')
-rw-r--r--src/gpm-engine.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/gpm-engine.c b/src/gpm-engine.c
index 4ffce52..248553c 100644
--- a/src/gpm-engine.c
+++ b/src/gpm-engine.c
@@ -864,7 +864,7 @@ gpm_engine_coldplug_idle_cb (GpmEngine *engine)
gpm_engine_recalculate_state (engine);
/* add to database */
- array = up_client_get_devices (engine->priv->client);
+ array = up_client_get_devices2 (engine->priv->client);
for (i=0;i<array->len;i++) {
device = g_ptr_array_index (array, i);
gpm_engine_device_add (engine, device);