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



commit 3a07bb98db997f7c471954985614c875859568c4
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 da82677281..2b341dbedc 100644
--- a/gtk/a11y/gtkatspiroot.c
+++ b/gtk/a11y/gtkatspiroot.c
@@ -279,6 +279,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;
 
@@ -333,6 +335,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]