From bf90656ab77ff89ce89e41cc821197db79d32c58 Mon Sep 17 00:00:00 2001 From: rfm Date: Wed, 8 Jan 2025 22:38:13 +0000 Subject: [PATCH] fix leaks --- Tests/base/NSCountedSet/basic.m | 2 +- Tests/base/NSDictionary/general.m | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/Tests/base/NSCountedSet/basic.m b/Tests/base/NSCountedSet/basic.m index 483f4e7a9..203aee0c8 100644 --- a/Tests/base/NSCountedSet/basic.m +++ b/Tests/base/NSCountedSet/basic.m @@ -5,7 +5,7 @@ int main() { NSAutoreleasePool *arp = [NSAutoreleasePool new]; - id testObject = [NSCountedSet new]; + id testObject = AUTORELEASE([NSCountedSet new]); test_alloc(@"NSCountedSet"); test_NSObject(@"NSCountedSet",[NSArray arrayWithObject:testObject]); test_NSCoding([NSArray arrayWithObject:testObject]); diff --git a/Tests/base/NSDictionary/general.m b/Tests/base/NSDictionary/general.m index b88fced99..0f396831f 100644 --- a/Tests/base/NSDictionary/general.m +++ b/Tests/base/NSDictionary/general.m @@ -110,7 +110,7 @@ int main() [obj count] == 0, "-description gives us a text property-list"); - dict = [[NSDictionary dictionaryWithObjects:vals1 forKeys:keys1] retain]; + ASSIGN(dict, [NSDictionary dictionaryWithObjects:vals1 forKeys:keys1]); PASS(dict != nil && [dict isKindOfClass:[NSDictionary class]] && [dict count] == 2, @@ -263,6 +263,7 @@ int main() @"val", a, @"val2", @"key2", nil]; PASS_EQUAL([d objectForKey: a], @"val", "array as dictionary key works") + RELEASE(dict); [arp release]; arp = nil; return 0; }