Fix leaks

This commit is contained in:
rfm 2024-11-15 20:48:09 +00:00
parent 8209fa428f
commit 77c66e3d95
23 changed files with 287 additions and 259 deletions

View file

@ -469,6 +469,7 @@ static SEL appSel;
if (objectCount != [keys count])
{
RELEASE(self);
[NSException raise: NSInvalidArgumentException
format: @"init with obj and key arrays of different sizes"];
}

View file

@ -91,11 +91,11 @@ static Class NSFileHandle_ssl_class = nil;
{
if (self == NSFileHandle_abstract_class)
{
return NSAllocateObject (NSFileHandle_concrete_class, 0, z);
return NSAllocateObject(NSFileHandle_concrete_class, 0, z);
}
else
{
return NSAllocateObject (self, 0, z);
return NSAllocateObject(self, 0, z);
}
}

View file

@ -989,7 +989,7 @@ static gs_mutex_t classLock = GS_MUTEX_INIT_STATIC;
errorHandler: handler
for: self];
return direnum;
return AUTORELEASE(direnum);
}
- (NSArray*) contentsOfDirectoryAtPath: (NSString*)path error: (NSError**)error

View file

@ -121,6 +121,7 @@
[_invocation getReturnValue: buffer];
result = [NSValue valueWithBytes: buffer objCType: returnType];
free(buffer);
}
}
return result;

View file

@ -75,8 +75,6 @@ static void *isFinishedCtxt = (void*)"isFinished";
static void *isReadyCtxt = (void*)"isReady";
static void *queuePriorityCtxt = (void*)"queuePriority";
static NSArray *empty = nil;
@interface NSOperation (Private)
- (void) _finish;
- (void) _updateReadyState;
@ -91,12 +89,6 @@ static NSArray *empty = nil;
return NO;
}
+ (void) initialize
{
empty = [NSArray new];
RELEASE([NSObject leakAt: &empty]);
}
- (void) addDependency: (NSOperation *)op
{
if (NO == [op isKindOfClass: [NSOperation class]])
@ -228,7 +220,7 @@ static NSArray *empty = nil;
if (internal->dependencies == nil)
{
a = empty; // OSX return an empty array
a = [NSArray array]; // OSX return an empty array
}
else
{