[gtk+] a11y: Fix warnings when removing widgets that don't have accessibles



commit 05eb4113d9c7fc4c008fa4e9357eeea7184662f4
Author: Benjamin Otte <otte redhat com>
Date:   Sat Jul 9 21:20:39 2011 +0200

    a11y: Fix warnings when removing widgets that don't have accessibles
    
    The remove handler would not check that removed widgets do indeed have
    an accessible associated with them and would happily run all the removal
    code with a NULL object. Not good.

 gtk/a11y/gtkcontaineraccessible.c |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)
---
diff --git a/gtk/a11y/gtkcontaineraccessible.c b/gtk/a11y/gtkcontaineraccessible.c
index f02020d..844fe84 100644
--- a/gtk/a11y/gtkcontaineraccessible.c
+++ b/gtk/a11y/gtkcontaineraccessible.c
@@ -142,6 +142,8 @@ gtk_container_accessible_real_remove_gtk (GtkContainer *container,
 
   atk_parent = ATK_OBJECT (data);
   atk_child = gtk_widget_get_accessible (widget);
+  if (atk_child == NULL)
+    return 1;
   accessible = GTK_CONTAINER_ACCESSIBLE (atk_parent);
 
   g_object_notify (G_OBJECT (atk_child), "accessible_parent");



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