[gnome-settings-daemon/wip/benzea/cleanups-and-small-fixes: 50/51] power: Fix upower related memory leak and deprecation warning



commit e0791b3fd15ae246b32831d7d9ee1862ee96c6f7
Author: Benjamin Berg <bberg redhat com>
Date:   Tue Feb 26 11:28:56 2019 +0100

    power: Fix upower related memory leak and deprecation warning
    
    We used to call up_client_get_devices which passes an array of devices
    but does not unreference the devices again when the array is destroyed.
    
    GsdPower did correctly reference the devices, so this fixes both a
    memory leak and a deprecation warning.

 plugins/power/gsd-power-manager.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
---
diff --git a/plugins/power/gsd-power-manager.c b/plugins/power/gsd-power-manager.c
index 06c97380..f82392b2 100644
--- a/plugins/power/gsd-power-manager.c
+++ b/plugins/power/gsd-power-manager.c
@@ -271,7 +271,7 @@ engine_coldplug (GsdPowerManager *manager)
         UpDevice *device;
 
         /* add to database */
-        array = up_client_get_devices (manager->up_client);
+        array = up_client_get_devices2 (manager->up_client);
 
         for (i = 0 ; array != NULL && i < array->len ; i++) {
                 device = g_ptr_array_index (array, i);


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]