Fix some memory issues
This commit is contained in:
parent
563660674a
commit
4b3886abb3
@ -191,9 +191,17 @@ static void ThrowAbstractionViolationException(id obj) GCC_ATTR((noreturn));
|
||||
weights = [plist oo_arrayForKey:kWeightsKey];
|
||||
|
||||
// Validate
|
||||
if (objects == nil || weights == nil) return nil;
|
||||
if (objects == nil || weights == nil)
|
||||
{
|
||||
[self release];
|
||||
return nil;
|
||||
}
|
||||
count = [objects count];
|
||||
if (count != [weights count]) return nil;
|
||||
if (count != [weights count])
|
||||
{
|
||||
[self release];
|
||||
return nil;
|
||||
}
|
||||
|
||||
// Extract contents.
|
||||
rawObjects = malloc(sizeof *rawObjects * count);
|
||||
@ -214,6 +222,7 @@ static void ThrowAbstractionViolationException(id obj) GCC_ATTR((noreturn));
|
||||
}
|
||||
else
|
||||
{
|
||||
[self release];
|
||||
self = nil;
|
||||
}
|
||||
|
||||
|
@ -163,9 +163,9 @@ static NSMutableSet *sPlayingSoundSources;
|
||||
[_channel setDelegate:[self class]];
|
||||
[_channel stop];
|
||||
_channel = nil;
|
||||
[self release];
|
||||
|
||||
[sPlayingSoundSources removeObject:self];
|
||||
[self release];
|
||||
}
|
||||
|
||||
OOSoundReleaseLock();
|
||||
|
Loading…
x
Reference in New Issue
Block a user