[gtk/a11y/atspi: 35/43] atspiroot: Don't leak references




commit 2f19e8ed5385f8e6be2b342d33ef0eca60a442d0
Author: Matthias Clasen <mclasen redhat com>
Date:   Fri Oct 9 18:21:15 2020 -0400

    atspiroot: Don't leak references
    
    The reffing getter trap, lurking behind g_list_model_get_item().

 gtk/a11y/gtkatspiroot.c | 4 ++++
 1 file changed, 4 insertions(+)
---
diff --git a/gtk/a11y/gtkatspiroot.c b/gtk/a11y/gtkatspiroot.c
index 3f64ebf82c..e8f7ef8817 100644
--- a/gtk/a11y/gtkatspiroot.c
+++ b/gtk/a11y/gtkatspiroot.c
@@ -281,6 +281,8 @@ handle_accessible_method (GDBusConnection       *connection,
         {
           window = g_list_model_get_item (self->toplevels, i);
 
+          g_object_unref (window);
+
           if (!gtk_widget_get_visible (window))
             continue;
 
@@ -335,6 +337,8 @@ handle_accessible_get_property (GDBusConnection       *connection,
 
           if (gtk_widget_get_visible (window))
             n_children += 1;
+
+          g_object_unref (window);
         }
 
       res = g_variant_new_int32 (n_children);


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