diff --git a/AUTHORS b/AUTHORS index d7bf7ec2c..514ba701c 100644 --- a/AUTHORS +++ b/AUTHORS @@ -112,7 +112,6 @@ Michael Demars Rashid Eissing + Transfers preferences icon - + Interface conceptualization Deanna Phillips + Manpage for transmissioncli diff --git a/macosx/Controller.m b/macosx/Controller.m index 9998ca59b..c3fe1f4f1 100644 --- a/macosx/Controller.m +++ b/macosx/Controller.m @@ -161,8 +161,8 @@ static void sleepCallBack(void * controller, io_service_t y, natural_t messageTy { fLib = tr_init("macosx"); - fTorrents = [[NSMutableArray alloc] init]; - fDisplayedTorrents = [[NSMutableArray alloc] init]; + fTorrents = [[[NSMutableArray alloc] init] retain]; + fDisplayedTorrents = [[[NSMutableArray alloc] init] retain]; fPendingTorrentDownloads = [[NSMutableDictionary alloc] init]; fDefaults = [NSUserDefaults standardUserDefaults]; @@ -178,7 +178,6 @@ static void sleepCallBack(void * controller, io_service_t y, natural_t messageTy fRemoteQuit = NO; [GrowlApplicationBridge setGrowlDelegate: self]; - [[UKKQueue sharedFileWatcher] setDelegate: self]; } return self; @@ -193,8 +192,10 @@ static void sleepCallBack(void * controller, io_service_t y, natural_t messageTy [fPrefsController release]; [fToolbar release]; + [fTorrents release]; [fDisplayedTorrents release]; + [fBadger release]; if (fOverlayWindow) [fOverlayWindow release]; @@ -297,9 +298,11 @@ static void sleepCallBack(void * controller, io_service_t y, natural_t messageTy //old version saved transfer info in prefs file if (!history) + { if ((history = [fDefaults arrayForKey: @"History"])) [history retain]; - [fDefaults removeObjectForKey: @"History"]; + [fDefaults removeObjectForKey: @"History"]; + } if (history) { @@ -370,7 +373,7 @@ static void sleepCallBack(void * controller, io_service_t y, natural_t messageTy currentFilterButton = fNoFilterButton; } - + [currentFilterButton setEnabled: YES]; //observe notifications @@ -431,8 +434,6 @@ static void sleepCallBack(void * controller, io_service_t y, natural_t messageTy [self applyFilter: nil]; - [fWindow makeKeyAndOrderFront: nil]; - if ([fDefaults boolForKey: @"InfoVisible"]) [self showInfo: nil]; @@ -544,6 +545,13 @@ static void sleepCallBack(void * controller, io_service_t y, natural_t messageTy //save history and stop running torrents [self updateTorrentHistory]; + + //make sure torrent is closed + enumerator = [fTorrents objectEnumerator]; + Torrent * torrent; + while ((torrent = [enumerator nextObject])) + [torrent closeTorrent]; + [fDisplayedTorrents removeAllObjects]; [fTorrents removeAllObjects]; @@ -1147,7 +1155,7 @@ static void sleepCallBack(void * controller, io_service_t y, natural_t messageTy if (!lowestOrderValue || [lowestOrderValue compare: currentOrderValue] == NSOrderedDescending) lowestOrderValue = currentOrderValue; - [torrent removeTorrent]; + [torrent closeRemoveTorrent]; [fTorrents removeObject: torrent]; [fDisplayedTorrents removeObject: torrent]; } @@ -1700,12 +1708,12 @@ static void sleepCallBack(void * controller, io_service_t y, natural_t messageTy NSMutableArray * tempTorrents = [[NSMutableArray alloc] initWithCapacity: [fTorrents count]]; NSString * filterType = [fDefaults stringForKey: @"Filter"]; - BOOL filtering = ![filterType isEqualToString: @"None"]; int downloading = 0, seeding = 0, paused = 0; BOOL isDownloading = [filterType isEqualToString: @"Download"], isSeeding = [filterType isEqualToString: @"Seed"], isPaused = [filterType isEqualToString: @"Pause"]; + BOOL filtering = isDownloading || isSeeding || isPaused; //get count of each type NSEnumerator * enumerator = [fTorrents objectEnumerator]; diff --git a/macosx/Credits.rtf b/macosx/Credits.rtf index 6f274efeb..b0a7eb808 100644 --- a/macosx/Credits.rtf +++ b/macosx/Credits.rtf @@ -117,7 +117,6 @@ Michael Demars \ \ Rashid Eissing\ + Transfers preferences icon\ - + Interface conceptualization\ \ Deanna Phillips\ + Manpage for transmissioncli\ diff --git a/macosx/Torrent.h b/macosx/Torrent.h index 6a09dbed8..f0a5bb162 100644 --- a/macosx/Torrent.h +++ b/macosx/Torrent.h @@ -75,7 +75,8 @@ - (NSDictionary *) history; -- (void) removeTorrent; +- (void) closeTorrent; +- (void) closeRemoveTorrent; - (void) changeIncompleteDownloadFolder: (NSString *) folder; - (void) changeDownloadFolder: (NSString *) folder; diff --git a/macosx/Torrent.m b/macosx/Torrent.m index 8fe278304..65fbcdb9e 100644 --- a/macosx/Torrent.m +++ b/macosx/Torrent.m @@ -192,10 +192,9 @@ static uint32_t kRed = BE(0xFF6450FF), //255, 100, 80 - (void) dealloc { + # warning cleanup if (fHandle) { - tr_torrentClose(fHandle); - if (fDownloadFolder) [fDownloadFolder release]; if (fIncompleteFolder) @@ -231,9 +230,15 @@ static uint32_t kRed = BE(0xFF6450FF), //255, 100, 80 [super dealloc]; } -- (void) removeTorrent +- (void) closeTorrent +{ + tr_torrentClose(fHandle); +} + +- (void) closeRemoveTorrent { tr_torrentRemoveSaved(fHandle); + [self closeTorrent]; } - (void) changeIncompleteDownloadFolder: (NSString *) folder @@ -1497,7 +1502,6 @@ static uint32_t kRed = BE(0xFF6450FF), //255, 100, 80 fIncompleteFolder = [[fIncompleteFolder stringByExpandingTildeInPath] retain]; } - #warning duplicate warning? NSString * currentDownloadFolder; tr_info_t info; int error;