summaryrefslogtreecommitdiffstats
path: root/chrome/browser/cocoa
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 /chrome/browser/cocoa
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
Diffstat (limited to 'chrome/browser/cocoa')
-rw-r--r--chrome/browser/cocoa/find_pasteboard_unittest.mm19
1 files changed, 12 insertions, 7 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) {