[sysprof/wip/gtk4-port: 113/131] libsysprof-ui: fix unrefing of unused visualizers




commit eb18defbc53e326d259c396d231a7ed49b4c3724
Author: Christian Hergert <chergert redhat com>
Date:   Fri Oct 1 13:59:42 2021 -0700

    libsysprof-ui: fix unrefing of unused visualizers

 src/libsysprof-ui/sysprof-cpu-aid.c  | 6 +++---
 src/libsysprof-ui/sysprof-rapl-aid.c | 2 +-
 2 files changed, 4 insertions(+), 4 deletions(-)
---
diff --git a/src/libsysprof-ui/sysprof-cpu-aid.c b/src/libsysprof-ui/sysprof-cpu-aid.c
index 225b7a6c..febdf876 100644
--- a/src/libsysprof-ui/sysprof-cpu-aid.c
+++ b/src/libsysprof-ui/sysprof-cpu-aid.c
@@ -323,17 +323,17 @@ sysprof_cpu_aid_present_finish (SysprofAid    *aid,
       if (has_usage && !found_combined)
         sysprof_visualizer_group_insert (usage, over_row, 0, FALSE);
       else
-        g_object_unref (GTK_WIDGET (over_row));
+        g_object_unref (g_object_ref_sink (over_row));
 
       if (has_usage)
         sysprof_display_add_group (present->display, usage);
       else
-        g_object_unref (GTK_WIDGET (usage));
+        g_object_unref (g_object_ref_sink (usage));
 
       if (has_freq)
         sysprof_display_add_group (present->display, freq);
       else
-        g_object_unref (GTK_WIDGET (freq));
+        g_object_unref (g_object_ref_sink (freq));
     }
 
   return counters != NULL;
diff --git a/src/libsysprof-ui/sysprof-rapl-aid.c b/src/libsysprof-ui/sysprof-rapl-aid.c
index 0102a1ef..71c5d127 100644
--- a/src/libsysprof-ui/sysprof-rapl-aid.c
+++ b/src/libsysprof-ui/sysprof-rapl-aid.c
@@ -227,7 +227,7 @@ sysprof_rapl_aid_present_finish (SysprofAid    *aid,
       if (found > 0)
         sysprof_display_add_group (present->display, energy);
       else
-        g_object_unref (energy);
+        g_object_unref (g_object_ref_sink (energy));
     }
 
   return counters != NULL;


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