Skip to content
Permalink
Browse files
<http://webkit.org/b/59755> AXObjectCache::attachWrapper() over-retai…
…ns an AccessibilityObjectWrapper

Reviewed by Chris Fleizach.

Previously, AXObjectCache::attachWrapper over-retained each
AccessibilityObjectWrapper it created, which is why
AXObjectCache::detachWrapper() contained an extra -release.

* accessibility/mac/AXObjectCacheMac.mm:
(WebCore::AXObjectCache::detachWrapper): Removed extra -release.
(WebCore::AXObjectCache::attachWrapper): Because setWrapper()
assigns to a RetainPtr<> instance variable, it doesn't need a +1
retained object passed in.  Fix the leak by using a RetainPtr<>
for the AccessibilityObjectWrapper.

Canonical link: https://commits.webkit.org/74974@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@85263 268f45cc-cd09-0410-ab3c-d52691b4dbfc
  • Loading branch information
ddkilzer committed Apr 28, 2011
1 parent 3af2025 commit dd259e47046b7c104a01a12eea07714c16b9921b
Showing with 19 additions and 2 deletions.
  1. +17 −0 Source/WebCore/ChangeLog
  2. +2 −2 Source/WebCore/accessibility/mac/AXObjectCacheMac.mm
@@ -1,3 +1,20 @@
2011-04-28 David Kilzer <ddkilzer@apple.com>

<http://webkit.org/b/59755> AXObjectCache::attachWrapper() over-retains an AccessibilityObjectWrapper

Reviewed by Chris Fleizach.

Previously, AXObjectCache::attachWrapper over-retained each
AccessibilityObjectWrapper it created, which is why
AXObjectCache::detachWrapper() contained an extra -release.

* accessibility/mac/AXObjectCacheMac.mm:
(WebCore::AXObjectCache::detachWrapper): Removed extra -release.
(WebCore::AXObjectCache::attachWrapper): Because setWrapper()
assigns to a RetainPtr<> instance variable, it doesn't need a +1
retained object passed in. Fix the leak by using a RetainPtr<>
for the AccessibilityObjectWrapper.

2011-04-28 Nat Duca <nduca@chromium.org>

Reviewed by Darin Fisher.
@@ -46,13 +46,13 @@
void AXObjectCache::detachWrapper(AccessibilityObject* obj)
{
[obj->wrapper() detach];
[obj->wrapper() release];
obj->setWrapper(0);
}

void AXObjectCache::attachWrapper(AccessibilityObject* obj)
{
obj->setWrapper([[AccessibilityObjectWrapper alloc] initWithAccessibilityObject:obj]);
RetainPtr<AccessibilityObjectWrapper> wrapper(AdoptNS, [[AccessibilityObjectWrapper alloc] initWithAccessibilityObject:obj]);
obj->setWrapper(wrapper.get());
}

void AXObjectCache::postPlatformNotification(AccessibilityObject* obj, AXNotification notification)

0 comments on commit dd259e4

Please sign in to comment.