Skip to content

Commit

Permalink
Fix valgrind error.
Browse files Browse the repository at this point in the history
BUG=59963
TEST=run chrome_test.sh from valgrind scripts and run unit test for BrowserAccessibilityTest.*.
Review URL: http://codereview.chromium.org/3995006

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@63405 0039d316-1c4b-4281-b951-d872f2087c98
  • Loading branch information
dtseng@chromium.org committed Oct 21, 2010
1 parent 2fe15fc commit 3438224
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 17 deletions.
9 changes: 6 additions & 3 deletions chrome/browser/accessibility/browser_accessibility_mac.mm
Original file line number Diff line number Diff line change
Expand Up @@ -33,12 +33,15 @@

void BrowserAccessibilityMac::ReleaseReference() {
if (browser_accessibility_cocoa_) {
// Relinquish ownership of the cocoa obj.
[browser_accessibility_cocoa_ release];
BrowserAccessibilityCocoa* temp = browser_accessibility_cocoa_;
browser_accessibility_cocoa_ = nil;
// Relinquish ownership of the cocoa obj.
[temp release];
// At this point, other processes may have a reference to
// browser_accessibility_cocoa_. When the retain count hits zero, it will
// the cocoa object. When the retain count hits zero, it will
// destroy us in dealloc.
// For that reason, do *not* make any more calls here after
// as we might have been deleted.
}
}

Expand Down
14 changes: 0 additions & 14 deletions tools/valgrind/memcheck/suppressions_mac.txt
Original file line number Diff line number Diff line change
Expand Up @@ -898,17 +898,3 @@
fun:_ZN24BrowserAccessibilityTest5SetUpEv
fun:_ZN7testingL35HandleExceptionsInMethodIfSupportedINS_4TestEvEET0_PT_MS3_FS2_vEPKc
}
{
bug_59963
Memcheck:Addr4
fun:_ZN23BrowserAccessibilityMac16ReleaseReferenceEv
...
fun:_ZN27BrowserAccessibilityManagerD2Ev
fun:_ZN30BrowserAccessibilityManagerMacD0Ev
fun:_ZN10scoped_ptrI27BrowserAccessibilityManagerED2Ev
fun:_ZN10scoped_ptrI27BrowserAccessibilityManagerED1Ev
fun:_ZN24BrowserAccessibilityTestD2Ev
fun:_ZN41BrowserAccessibilityTest_*
fun:_ZN7testing4Test11DeleteSelf_Ev
fun:_ZN7testingL35HandleExceptionsInMethodIfSupportedINS_4TestEvEET0_PT_MS3_FS2_vEPKc
}

0 comments on commit 3438224

Please sign in to comment.