mirror of
https://github.com/transmission/transmission.git
synced 2025-12-24 12:28:52 +00:00
use autorelease pools when handling downloading/seeding state changes
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user