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];
|
weights = [plist oo_arrayForKey:kWeightsKey];
|
||||||
|
|
||||||
// Validate
|
// Validate
|
||||||
if (objects == nil || weights == nil) return nil;
|
if (objects == nil || weights == nil)
|
||||||
|
{
|
||||||
|
[self release];
|
||||||
|
return nil;
|
||||||
|
}
|
||||||
count = [objects count];
|
count = [objects count];
|
||||||
if (count != [weights count]) return nil;
|
if (count != [weights count])
|
||||||
|
{
|
||||||
|
[self release];
|
||||||
|
return nil;
|
||||||
|
}
|
||||||
|
|
||||||
// Extract contents.
|
// Extract contents.
|
||||||
rawObjects = malloc(sizeof *rawObjects * count);
|
rawObjects = malloc(sizeof *rawObjects * count);
|
||||||
@ -214,6 +222,7 @@ static void ThrowAbstractionViolationException(id obj) GCC_ATTR((noreturn));
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
[self release];
|
||||||
self = nil;
|
self = nil;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -163,9 +163,9 @@ static NSMutableSet *sPlayingSoundSources;
|
|||||||
[_channel setDelegate:[self class]];
|
[_channel setDelegate:[self class]];
|
||||||
[_channel stop];
|
[_channel stop];
|
||||||
_channel = nil;
|
_channel = nil;
|
||||||
[self release];
|
|
||||||
|
|
||||||
[sPlayingSoundSources removeObject:self];
|
[sPlayingSoundSources removeObject:self];
|
||||||
|
[self release];
|
||||||
}
|
}
|
||||||
|
|
||||||
OOSoundReleaseLock();
|
OOSoundReleaseLock();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user