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,17 +5,17 @@
int main()
{
NSAutoreleasePool *arp = [NSAutoreleasePool new];
id testObj;
ENTER_POOL
id testObj;
PASS([NSRunLoop new] == nil, "run loop initialises to nil");
testObj = [NSRunLoop currentRunLoop];
test_NSObject(@"NSRunLoop", [NSArray arrayWithObject:testObj]);
test_NSObject(@"NSRunLoop", [NSArray arrayWithObject: testObj]);
PASS([NSTimer new] == nil, "timer initialises to nil");
ASSIGN(testObj, [[NSTimer alloc] initWithFireDate: 0 interval: 0 target: [NSObject class] selector: @selector(description) userInfo: nil repeats: NO]);
test_NSObject(@"NSTimer", [NSArray arrayWithObject:testObj]);
PASS(AUTORELEASE([NSTimer new]) == nil, "timer initialises to nil");
testObj = AUTORELEASE([[NSTimer alloc] initWithFireDate: 0 interval: 0 target: [NSObject class] selector: @selector(description) userInfo: nil repeats: NO]);
test_NSObject(@"NSTimer", [NSArray arrayWithObject: testObj]);
[arp release]; arp = nil;
LEAVE_POOL
return 0;
}

View file

@ -83,7 +83,7 @@ const NSTimeInterval kDelay = 0.01;
- (void) run
{
NSDate *until = [NSDate dateWithTimeIntervalSinceNow: 1.0];
Counter *c = [Counter new];
Counter *c = AUTORELEASE([Counter new]);
[NSTimer scheduledTimerWithTimeInterval: 1.0
target: self
selector: @selector(timeout:)