]> granicus.if.org Git - transmission/commitdiff
use autorelease pools when handling downloading/seeding state changes
authorMitchell Livingston <livings124@transmissionbt.com>
Thu, 30 Dec 2010 12:33:37 +0000 (12:33 +0000)
committerMitchell Livingston <livings124@transmissionbt.com>
Thu, 30 Dec 2010 12:33:37 +0000 (12:33 +0000)
macosx/Controller.m

index ff7420692954a624e07723240ea7435f93c45375..aa2bafd0ec8ea76b98d163a1e57195a8091d57b2 100644 (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