]> granicus.if.org Git - transmission/commitdiff
don't attempt to generate the dock menu when quitting
authorMitchell Livingston <livings124@transmissionbt.com>
Fri, 5 Aug 2011 23:21:34 +0000 (23:21 +0000)
committerMitchell Livingston <livings124@transmissionbt.com>
Fri, 5 Aug 2011 23:21:34 +0000 (23:21 +0000)
macosx/Controller.m

index ed5e9e81ec825fb102443730c8d7517a98356d7a..cf500c1ab5f2c50920a9ab3fecce73342a9ca89c 100644 (file)
@@ -3876,17 +3876,17 @@ static void sleepCallback(void * controller, io_service_t y, natural_t messageTy
 
 - (NSMenu *) applicationDockMenu: (NSApplication *) sender
 {
+    if (fQuitting)
+        return nil;
+    
     NSInteger seeding = 0, downloading = 0;
-    if (!fQuitting)
+    for (Torrent * torrent in fTorrents)
     {
-        for (Torrent * torrent in fTorrents)
-        {
-            if ([torrent isSeeding])
-                seeding++;
-            else if ([torrent isActive])
-                downloading++;
-            else;
-        }
+        if ([torrent isSeeding])
+            seeding++;
+        else if ([torrent isActive])
+            downloading++;
+        else;
     }
     
     NSMenu * menu = [[NSMenu alloc] init];