[sysprof/wip/gtk4-port: 107/132] libsysprof-ui: fix some floating unrefs




commit 55087312aa771c780bf2b4698b239a47b43c3efb
Author: Christian Hergert <chergert redhat com>
Date:   Fri Oct 1 13:47:55 2021 -0700

    libsysprof-ui: fix some floating unrefs

 src/libsysprof-ui/sysprof-battery-aid.c  | 2 +-
 src/libsysprof-ui/sysprof-diskstat-aid.c | 2 +-
 src/libsysprof-ui/sysprof-netdev-aid.c   | 2 +-
 3 files changed, 3 insertions(+), 3 deletions(-)
---
diff --git a/src/libsysprof-ui/sysprof-battery-aid.c b/src/libsysprof-ui/sysprof-battery-aid.c
index 6adca861..9351200f 100644
--- a/src/libsysprof-ui/sysprof-battery-aid.c
+++ b/src/libsysprof-ui/sysprof-battery-aid.c
@@ -218,7 +218,7 @@ sysprof_battery_aid_present_finish (SysprofAid    *aid,
       if (found > 0)
         sysprof_display_add_group (present->display, group);
       else
-        g_object_unref (group);
+        g_object_unref (g_object_ref_sink (group));
     }
 
   return counters != NULL;
diff --git a/src/libsysprof-ui/sysprof-diskstat-aid.c b/src/libsysprof-ui/sysprof-diskstat-aid.c
index 614c0466..676ea4a3 100644
--- a/src/libsysprof-ui/sysprof-diskstat-aid.c
+++ b/src/libsysprof-ui/sysprof-diskstat-aid.c
@@ -245,7 +245,7 @@ sysprof_diskstat_aid_present_finish (SysprofAid    *aid,
       if (counters->len > 0)
         sysprof_display_add_group (present->display, group);
       else
-        g_object_unref (group);
+        g_object_unref (g_object_ref_sink (group));
     }
 
   return counters != NULL;
diff --git a/src/libsysprof-ui/sysprof-netdev-aid.c b/src/libsysprof-ui/sysprof-netdev-aid.c
index 7de8dc21..5f1c9f2c 100644
--- a/src/libsysprof-ui/sysprof-netdev-aid.c
+++ b/src/libsysprof-ui/sysprof-netdev-aid.c
@@ -242,7 +242,7 @@ sysprof_netdev_aid_present_finish (SysprofAid    *aid,
       if (counters->len > 0)
         sysprof_display_add_group (present->display, group);
       else
-        g_object_unref (group);
+        g_object_unref (g_object_ref_sink (group));
     }
 
   return counters != NULL;


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