More leak fixes

This commit is contained in:
rfm 2024-11-16 21:11:56 +00:00
parent d68e8be8ee
commit 5b46efa8cd
14 changed files with 65 additions and 55 deletions

View file

@ -5,11 +5,12 @@
int main()
{
NSAutoreleasePool *arp = [NSAutoreleasePool new];
ENTER_POOL
NSMutableDictionary *dict = [NSMutableDictionary dictionary];
[dict setObject:@"value" forKey:@"key"];
NSProgress *progress = [[NSProgress alloc] initWithParent: nil
userInfo: dict];
NSProgress *progress = AUTORELEASE([[NSProgress alloc] initWithParent: nil
userInfo: dict]);
PASS(progress != nil,
"[NSProgress initWithParent:userInfo:] returns instance");
@ -42,14 +43,14 @@ int main()
NSProgress *new_progress = [NSProgress progressWithTotalUnitCount:100
parent:progress
pendingUnitCount:50];
[new_progress addChild:[[NSProgress alloc] initWithParent: nil userInfo: nil]
withPendingUnitCount:50];
[new_progress addChild: AUTORELEASE([[NSProgress alloc]
initWithParent: nil userInfo: nil]) withPendingUnitCount:50];
[currentProgress resignCurrent];
PASS([NSProgress currentProgress] == nil,
"Current progress is nil after resign current");
[arp release]; arp = nil;
LEAVE_POOL
return 0;
}