use autorelease pools when handling downloading/seeding state changes
This commit is contained in:
parent
efcbab893f
commit
1fb6eaa34e
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue