[Webkit-unassigned] [Bug 42092] [Chromium] Fix adoptRef usage violation in WebAccessibilityCacheImpl.cpp

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Mon Jul 12 14:03:07 PDT 2010


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


Darin Adler <darin at apple.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
  Attachment #61267|review?, commit-queue?      |review+, commit-queue+
               Flag|                            |




--- Comment #4 from Darin Adler <darin at apple.com>  2010-07-12 14:03:07 PST ---
(From update of attachment 61267)
>      // FIXME: Remove resetting ref-count from AccessibilityObjectWrapper
> -    // and convert to use adoptRef.

Should add the period on the line you are keeping.

> -    return new WebAccessibilityCacheImpl::WeakHandle(object);
> +    RefPtr<WebAccessibilityCacheImpl::WeakHandle> weakHandle = adoptRef(new WebAccessibilityCacheImpl::WeakHandle(object));
> +    weakHandle->m_object->setWrapper(weakHandle.get());
> +    
> +    return weakHandle;

This should be "return weakHandle.release()" for best performance. Avoids one round of reference counting churn.

It looks like this change actually fixes a storage leak that was happening here. Or maybe not because of whatever "resetting ref-count from AccessibilityObjectWrapper" is.

I’ll say r=me but I think this is not completely right.

-- 
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