use autorelease pools when handling downloading/seeding state changes

This commit is contained in:
Mitchell Livingston 2010-12-30 12:33:37 +00:00
parent efcbab893f
commit 1fb6eaa34e
1 changed files with 12 additions and 0 deletions

View File

@ -1911,6 +1911,8 @@ static void sleepCallback(void * controller, io_service_t y, natural_t messageTy
- (void) torrentFinishedDownloading: (NSNotification *) notification
{
NSAutoreleasePool * pool = [[NSAutoreleasePool alloc] init];
Torrent * torrent = [notification object];
if ([[[notification userInfo] objectForKey: @"WasRunning"] boolValue])
@ -1951,10 +1953,14 @@ static void sleepCallback(void * controller, io_service_t y, natural_t messageTy
}
[self updateTorrentsInQueue];
[pool drain];
}
- (void) torrentRestartedDownloading: (NSNotification *) notification
{
NSAutoreleasePool * pool = [[NSAutoreleasePool alloc] init];
Torrent * torrent = [notification object];
if ([torrent isActive] && [fDefaults boolForKey: @"Queue"] && [self numToStartFromQueue: YES] == 0)
{
@ -1963,10 +1969,14 @@ static void sleepCallback(void * controller, io_service_t y, natural_t messageTy
}
[self updateTorrentsInQueue];
[pool drain];
}
- (void) torrentFinishedSeeding: (NSNotification *) notification
{
NSAutoreleasePool * pool = [[NSAutoreleasePool alloc] init];
Torrent * torrent = [notification object];
[self updateTorrentsInQueue];
@ -1997,6 +2007,8 @@ static void sleepCallback(void * controller, io_service_t y, natural_t messageTy
[GrowlApplicationBridge notifyWithTitle: NSLocalizedString(@"Seeding Complete", "Growl notification title")
description: [torrent name] notificationName: GROWL_SEEDING_COMPLETE
iconData: nil priority: 0 isSticky: NO clickContext: clickContext];
[pool drain];
}
- (void) updateTorrentHistory