fix leaks

This commit is contained in:
rfm 2025-01-08 22:38:13 +00:00
parent ce6f8ff6b7
commit bf90656ab7
2 changed files with 3 additions and 2 deletions

View file

@ -5,7 +5,7 @@
int main() int main()
{ {
NSAutoreleasePool *arp = [NSAutoreleasePool new]; NSAutoreleasePool *arp = [NSAutoreleasePool new];
id testObject = [NSCountedSet new]; id testObject = AUTORELEASE([NSCountedSet new]);
test_alloc(@"NSCountedSet"); test_alloc(@"NSCountedSet");
test_NSObject(@"NSCountedSet",[NSArray arrayWithObject:testObject]); test_NSObject(@"NSCountedSet",[NSArray arrayWithObject:testObject]);
test_NSCoding([NSArray arrayWithObject:testObject]); test_NSCoding([NSArray arrayWithObject:testObject]);

View file

@ -110,7 +110,7 @@ int main()
[obj count] == 0, [obj count] == 0,
"-description gives us a text property-list"); "-description gives us a text property-list");
dict = [[NSDictionary dictionaryWithObjects:vals1 forKeys:keys1] retain]; ASSIGN(dict, [NSDictionary dictionaryWithObjects:vals1 forKeys:keys1]);
PASS(dict != nil && PASS(dict != nil &&
[dict isKindOfClass:[NSDictionary class]] && [dict isKindOfClass:[NSDictionary class]] &&
[dict count] == 2, [dict count] == 2,
@ -263,6 +263,7 @@ int main()
@"val", a, @"val2", @"key2", nil]; @"val", a, @"val2", @"key2", nil];
PASS_EQUAL([d objectForKey: a], @"val", "array as dictionary key works") PASS_EQUAL([d objectForKey: a], @"val", "array as dictionary key works")
RELEASE(dict);
[arp release]; arp = nil; [arp release]; arp = nil;
return 0; return 0;
} }