fixed some memory leaks found in the analyzer
This commit is contained in:
@@ -362,13 +362,14 @@ SYNTHESIZE_SINGLETON_FOR_CLASS(SoundManager);
|
||||
NSMutableArray *playlistTracks = [musicPlaylists objectForKey:aPlaylistName];
|
||||
|
||||
if (!playlistTracks) {
|
||||
playlistTracks = [[NSMutableArray alloc] init];
|
||||
playlistTracks = [NSMutableArray arrayWithCapacity: 1];
|
||||
}
|
||||
|
||||
[playlistTracks addObject:aTrackName];
|
||||
|
||||
// Add the track key to the play list
|
||||
[musicPlaylists setObject:playlistTracks forKey:aPlaylistName];
|
||||
|
||||
}
|
||||
|
||||
- (void)startPlaylistNamed:(NSString*)aPlaylistName {
|
||||
@@ -391,14 +392,15 @@ SYNTHESIZE_SINGLETON_FOR_CLASS(SoundManager);
|
||||
|
||||
NSMutableArray *playlistTracks = [musicPlaylists objectForKey:aPlaylistName];
|
||||
if (playlistTracks) {
|
||||
int indexToRemove;
|
||||
for (int index=0; index < [currentPlaylistTracks count]; index++) {
|
||||
int indexToRemove = -1;
|
||||
for (NSUInteger index=0; index < [currentPlaylistTracks count]; index++) {
|
||||
if ([[currentPlaylistTracks objectAtIndex:index] isEqualToString:aTrackName]) {
|
||||
indexToRemove = index;
|
||||
break;
|
||||
}
|
||||
}
|
||||
[currentPlaylistTracks removeObjectAtIndex:indexToRemove];
|
||||
if (indexToRemove >= 0)
|
||||
[currentPlaylistTracks removeObjectAtIndex:indexToRemove];
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -1156,7 +1156,7 @@ static NSOperationQueue *sharedQueue = nil;
|
||||
// Create the stream for the request
|
||||
//
|
||||
|
||||
NSFileManager *fileManager = [[[NSFileManager alloc] init] autorelease];
|
||||
NSFileManager *fileManager = [NSFileManager defaultManager];
|
||||
|
||||
[self setReadStreamIsScheduled:NO];
|
||||
|
||||
@@ -1214,6 +1214,7 @@ static NSOperationQueue *sharedQueue = nil;
|
||||
CFReadStreamSetProperty((CFReadStreamRef)[self readStream],
|
||||
kCFStreamPropertySSLSettings,
|
||||
(CFTypeRef)sslProperties);
|
||||
[sslProperties release];
|
||||
}
|
||||
|
||||
// Tell CFNetwork to use a client certificate
|
||||
|
||||
Reference in New Issue
Block a user