Fix leaks

This commit is contained in:
rfm 2024-11-15 15:44:39 +00:00
parent bdad4987ae
commit 91be2c2c83
4 changed files with 7 additions and 7 deletions

View file

@ -76,8 +76,8 @@ int main()
"NSZoneFromPointer() returns zone where memory came from");
NS_DURING
[NSString allocWithZone:aZone];
NSRecycleZone(aZone);
NSZoneMalloc(aZone, 42);
NSRecycleZone(aZone);
PASS(1,"NSRecycleZone seems to operate");
NS_HANDLER
PASS(0,"NSRecycleZone seems to operate");

View file

@ -45,7 +45,7 @@ int main(int argc,char **argv)
result = [[array valueForKeyPath:@"@count"] intValue] == 2;
PASS(result, "-[NSArray valueForKeyPath: @\"@count\"]");
aiv = [ArrayIVar new];
aiv = AUTORELEASE([ArrayIVar new]);
ivar = [NSArray arrayWithObjects: @"Joe", @"Foo", @"Bar", @"Cat", nil];
[aiv setTestArray: ivar];

View file

@ -43,9 +43,9 @@ int main()
{
NSAutoreleasePool *arp = [NSAutoreleasePool new];
DefaultNil * defaultNil = [DefaultNil new];
DeprecatedNil * deprecatedNil = [DeprecatedNil new];
SetNil * setNil = [SetNil new];
DefaultNil *defaultNil = AUTORELEASE([DefaultNil new]);
DeprecatedNil *deprecatedNil = AUTORELEASE([DeprecatedNil new]);
SetNil *setNil = AUTORELEASE([SetNil new]);
PASS_EXCEPTION([defaultNil setValue: nil forKey: @"num"],
NSInvalidArgumentException, "KVC handles setting nil for a scalar")

View file

@ -33,7 +33,7 @@ int main()
tClass = NSClassFromString(@"InvokeTarget");
tar = [tClass new];
tar = AUTORELEASE([tClass new]);
/*
Test if the return value is retained. It is in the Apple OpenStep edition