diff options
-rw-r--r-- | chrome/browser/cocoa/find_pasteboard_unittest.mm | 19 | ||||
-rw-r--r-- | tools/valgrind/memcheck/suppressions_mac.txt | 20 |
2 files changed, 21 insertions, 18 deletions
diff --git a/chrome/browser/cocoa/find_pasteboard_unittest.mm b/chrome/browser/cocoa/find_pasteboard_unittest.mm index 643d95c..7f1a86b 100644 --- a/chrome/browser/cocoa/find_pasteboard_unittest.mm +++ b/chrome/browser/cocoa/find_pasteboard_unittest.mm @@ -15,7 +15,7 @@ @public int notificationCount_; @private - scoped_nsobject<NSPasteboard> pboard_; + NSPasteboard* pboard_; } - (NSPasteboard*)findPboard; @@ -31,13 +31,18 @@ - (id)init { if ((self = [super init])) { - pboard_.reset([[NSPasteboard pasteboardWithUniqueName] retain]); + pboard_ = [NSPasteboard pasteboardWithUniqueName]; } return self; } +- (void)dealloc { + [pboard_ releaseGlobally]; + [super dealloc]; +} + - (NSPasteboard*)findPboard { - return pboard_.get(); + return pboard_; } - (void)callback:(id)sender { @@ -45,13 +50,13 @@ } - (void)setFindPboardText:(NSString*)text { - [pboard_.get() declareTypes:[NSArray arrayWithObject:NSStringPboardType] + [pboard_ declareTypes:[NSArray arrayWithObject:NSStringPboardType] owner:nil]; - [pboard_.get() setString:text forType:NSStringPboardType]; + [pboard_ setString:text forType:NSStringPboardType]; } - (NSString*)findPboardText { - return [pboard_.get() stringForType:NSStringPboardType]; + return [pboard_ stringForType:NSStringPboardType]; } @end @@ -63,8 +68,8 @@ class FindPasteboardTest : public PlatformTest { pboard_.reset([[FindPasteboardTesting alloc] init]); } protected: - scoped_nsobject<FindPasteboardTesting> pboard_; CocoaTestHelper helper_; + scoped_nsobject<FindPasteboardTesting> pboard_; }; TEST_F(FindPasteboardTest, SettingTextUpdatesPboard) { diff --git a/tools/valgrind/memcheck/suppressions_mac.txt b/tools/valgrind/memcheck/suppressions_mac.txt index b07a808..aeac5b7 100644 --- a/tools/valgrind/memcheck/suppressions_mac.txt +++ b/tools/valgrind/memcheck/suppressions_mac.txt @@ -273,17 +273,6 @@ fun:+[NSObject alloc] fun:+[GTMTheme(BrowserThemeProviderInitialization) themeWithBrowserThemeProvider:isOffTheRecord:] } -{ - # Singleton that we leak, but only on shutdown. - find_pasteboard_singleton - Memcheck:Leak - fun:malloc_zone_malloc - fun:_CFRuntimeCreateInstance - fun:CFPasteboardCreate - fun:+[NSPasteboard _pasteboardWithName:] - fun:-[FindPasteboard findPboard] - fun:-[FindPasteboard setFindText:] -} # 3. Suppressions for real chromium bugs that are not yet fixed. { @@ -775,6 +764,15 @@ fun:+[NSPasteboard pasteboardWithUniqueName] } { + bug_21479 + Memcheck:Leak + fun:malloc_zone_malloc + fun:_CFRuntimeCreateInstance + fun:CFPasteboardCreate + fun:+[NSPasteboard _pasteboardWithName:] + fun:-[FindPasteboard findPboard] +} +{ bug_21645a Memcheck:Cond fun:_ZN3gfx4Size9set_widthEi |