[Webkit-unassigned] [Bug 31044] [Gtk] assertion when webkit_accessible_get_index_in_parent attempts to get parent of the web view

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Mon Nov 2 23:29:50 PST 2009


https://bugs.webkit.org/show_bug.cgi?id=31044


Xan Lopez <xan.lopez at gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
  Attachment #42361|review?                     |review-
               Flag|                            |




--- Comment #2 from Xan Lopez <xan.lopez at gmail.com>  2009-11-02 23:29:50 PDT ---
(From update of attachment 42361)
> +static AtkObject* webkit_accessible_get_parent(AtkObject* object)
> +{
> +    AccessibilityObject* coreParent = core(object)->parentObjectUnignored();
> +    if (!coreParent && core(object)->isWebArea())
> +        return atkParentOfWebView(object);
> +
> +    if (!coreParent)
> +        return NULL;

return 0;

> +
> +    return coreParent->wrapper();
> +}
> +
>  static gint webkit_accessible_get_n_children(AtkObject* object)
>  {
>      return core(object)->children().size();
> @@ -254,7 +266,16 @@ static gint webkit_accessible_get_index_in_parent(AtkObject* object)
>      AccessibilityObject* coreObject = core(object);
>      AccessibilityObject* parent = coreObject->parentObjectUnignored();
>  
> -    g_return_val_if_fail(parent, 0);
> +    if (!parent && core(object)->isWebArea()) {
> +        AtkObject* atkParent = atkParentOfWebView(object);
> +        if (!atkParent)
> +            return -1;
> +
> +        unsigned count = atk_object_get_n_accessible_children(atkParent);
> +        for (unsigned i = 0; i < count; ++i)
> +            if (atk_object_ref_accessible_child(atkParent, i) == object)

This is doing a g_object_ref on each child, and then letting it go, so it's
leaking all of them basically. You need to use GOwnPtr here, or similar, so
that the references go away when you exit the function.

> +                return i;
> +    }
>  
>      AccessibilityObject::AccessibilityChildrenVector children = parent->children();
>      unsigned count = children.size();
> @@ -263,7 +284,7 @@ static gint webkit_accessible_get_index_in_parent(AtkObject* object)
>              return i;
>      }
>  
> -    return 0;
> +    return -1;
>  }
>  
>  static AtkAttributeSet* addAttributeToSet(AtkAttributeSet* attributeSet, const char* name, const char* value)
> -- 
> 1.6.3.3
> 

r- for those two issues, but looks good to me otherwise.

-- 
Configure bugmail: https://bugs.webkit.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.



More information about the webkit-unassigned mailing list