Commit be59c3f5 authored by Felix Paul Kühne's avatar Felix Paul Kühne

fixed 9 potential memory leaks

parent 9071ba34
......@@ -41,6 +41,7 @@ NSString *kMLFileTypeTVShowEpisode = @"tvShowEpisode";
NSError *error;
NSArray *movies = [moc executeFetchRequest:request error:&error];
[request release];
[descriptor release];
if (!movies) {
NSLog(@"WARNING: %@", error);
}
......
......@@ -150,6 +150,7 @@ static inline NSString *hashFromFile(MLFile *file)
MLParsingOperation *op = [[MLParsingOperation alloc] initWithFile:file];
[_fileDescriptionToOperation setValue:op forKey:hashFromFile(file)];
[self.queue addOperation:op];
[op autorelease];
}
- (void)stop
......
......@@ -134,11 +134,14 @@ static NSString *kLastTVDBUpdateServerTime = @"MLLastTVDBUpdateServerTime";
#endif
persistentStore = [coordinator addPersistentStoreWithType:NSSQLiteStoreType configuration:nil URL:url options:options error:&error];
if (!persistentStore) {
if (coordinator)
[coordinator release];
#if! TARGET_OS_IPHONE
NSRunInformationalAlertPanel(@"Corrupted Media Library", @"There is nothing we can apparently do about it...", @"OK", nil, nil);
#else
UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@"Corrupted Media Library" message:@"There is nothing we can apparently do about it..." delegate:nil cancelButtonTitle:@"OK" otherButtonTitles:nil];
[alert show];
[alert autorelease];
#endif
// Probably assert instead.
return nil;
......
......@@ -24,6 +24,7 @@
NSArray *shows = [moc executeFetchRequest:request error:nil];
[request release];
[descriptor release];
return shows;
}
......
......@@ -31,6 +31,7 @@
NSArray *episodes = [moc executeFetchRequest:request error:nil];
[request release];
[descriptor release];
return episodes;
}
......
......@@ -59,6 +59,7 @@ static NSNumber *gServerTime = nil;
[array addObject:id];
}
[xmlDoc release];
[_delegate tvShowInfoGrabber:self didFetchUpdates:array];
} else {
NSAssert([connection.userObject isEqualToString:@"fetchServerTime"], @"Unkown callback emitter");
......@@ -74,6 +75,7 @@ static NSNumber *gServerTime = nil;
gServerTime = [serverTime retain];
gLastFetch = [[NSDate dateWithTimeIntervalSinceNow:0] retain];
[xmlDoc release];
[_delegate tvShowInfoGrabberDidFetchServerTime:self];
}
}
......
......@@ -152,6 +152,7 @@ static inline NSString *hashFromFile(MLFile *file)
ThumbnailOperation *op = [[ThumbnailOperation alloc] initWithFile:file];
[_fileDescriptionToOperation setValue:op forKey:hashFromFile(file)];
[self.queue addOperation:op];
[op autorelease];
}
- (void)stop
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment