summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorthakis@chromium.org <thakis@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-09-24 06:07:18 +0000
committerthakis@chromium.org <thakis@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-09-24 06:07:18 +0000
commitb60f230e9ad2f54ce1411a436d32591f3d893ae8 (patch)
tree7161871b89ee82a89b9feaf7165b1d6b792e2f5b
parentd46a1a5b2d7d713c74514e1d2ad39e9da492f575 (diff)
downloadchromium_src-b60f230e9ad2f54ce1411a436d32591f3d893ae8.zip
chromium_src-b60f230e9ad2f54ce1411a436d32591f3d893ae8.tar.gz
chromium_src-b60f230e9ad2f54ce1411a436d32591f3d893ae8.tar.bz2
Try to fix valgrind.
TBR: mark@chromium.org (Since this looks like something you've dealt with before) git-svn-id: svn://svn.chromium.org/chrome/trunk/src@27050 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r--chrome/browser/cocoa/find_pasteboard_unittest.mm19
-rw-r--r--tools/valgrind/memcheck/suppressions_mac.txt20
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