[gnome-shell] st-widget: Fix a potentially infinite recursion



commit b87da87252858a6d85f65b388f24803e190ab774
Author: Rui Matos <tiagomatos gmail com>
Date:   Thu Jan 21 16:39:58 2016 +0100

    st-widget: Fix a potentially infinite recursion
    
    Commit ffe4eaf00d8780bdc6fb3d7aca3eda847e887007 changed this code to
    call st_widget_get_accessible_role() instead of using the value
    directly which would be an infinite recursion if that function didn't
    have a bug. As it is, this just resulted in
    
    CRITICAL **: atk_object_get_role: assertion 'ATK_IS_OBJECT
    (accessible)' failed
    
    https://bugzilla.gnome.org/show_bug.cgi?id=760945

 src/st/st-widget.c |    8 ++++----
 1 files changed, 4 insertions(+), 4 deletions(-)
---
diff --git a/src/st/st-widget.c b/src/st/st-widget.c
index 6191e05..0f1a34e 100644
--- a/src/st/st-widget.c
+++ b/src/st/st-widget.c
@@ -2785,7 +2785,7 @@ static AtkRole
 st_widget_accessible_get_role (AtkObject *obj)
 {
   StWidget *widget = NULL;
-  AtkRole role;
+  StWidgetPrivate *priv;
 
   g_return_val_if_fail (ST_IS_WIDGET_ACCESSIBLE (obj), ATK_ROLE_INVALID);
 
@@ -2794,9 +2794,9 @@ st_widget_accessible_get_role (AtkObject *obj)
   if (widget == NULL)
     return ATK_ROLE_INVALID;
 
-  role = st_widget_get_accessible_role (widget);
-  if (role != ATK_ROLE_INVALID)
-    return role;
+  priv = st_widget_get_instance_private (widget);
+  if (priv->accessible_role != ATK_ROLE_INVALID)
+    return priv->accessible_role;
 
   return ATK_OBJECT_CLASS (st_widget_accessible_parent_class)->get_role (obj);
 }


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