[gtk/matthiasc/a11y: 27/28] atspiroot: Don't leak references




commit b1b1fe89c1475c4557bdc369b85d1d046f72acff
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 5c69c9be28..8eb83318fa 100644
--- a/gtk/a11y/gtkatspiroot.c
+++ b/gtk/a11y/gtkatspiroot.c
@@ -280,6 +280,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;
 
@@ -334,6 +336,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]