Changeset 2262


Ignore:
Timestamp:
Jul 1, 2007, 5:23:07 AM (15 years ago)
Author:
livings124
Message:

Don't make other actions rely on dealloc being called...it's not reliable. This should make quitting faster in many instances.

Location:
trunk
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/AUTHORS

    r2244 r2262  
    113113Rashid Eissing
    114114 + Transfers preferences icon
    115  + Interface conceptualization
    116115
    117116Deanna Phillips
  • trunk/macosx/Controller.m

    r2249 r2262  
    162162        fLib = tr_init("macosx");
    163163       
    164         fTorrents = [[NSMutableArray alloc] init];
    165         fDisplayedTorrents = [[NSMutableArray alloc] init];
     164        fTorrents = [[[NSMutableArray alloc] init] retain];
     165        fDisplayedTorrents = [[[NSMutableArray alloc] init] retain];
    166166        fPendingTorrentDownloads = [[NSMutableDictionary alloc] init];
    167167       
     
    179179       
    180180        [GrowlApplicationBridge setGrowlDelegate: self];
    181        
    182181        [[UKKQueue sharedFileWatcher] setDelegate: self];
    183182    }
     
    194193   
    195194    [fToolbar release];
     195   
    196196    [fTorrents release];
    197197    [fDisplayedTorrents release];
     198   
    198199    [fBadger release];
    199200    if (fOverlayWindow)
     
    298299    //old version saved transfer info in prefs file
    299300    if (!history)
     301    {
    300302        if ((history = [fDefaults arrayForKey: @"History"]))
    301303            [history retain];
    302     [fDefaults removeObjectForKey: @"History"];
     304        [fDefaults removeObjectForKey: @"History"];
     305    }
    303306   
    304307    if (history)
     
    371374        currentFilterButton = fNoFilterButton;
    372375    }
    373 
     376   
    374377    [currentFilterButton setEnabled: YES];
    375378   
     
    432435    [self applyFilter: nil];
    433436   
    434     [fWindow makeKeyAndOrderFront: nil];
    435 
    436437    if ([fDefaults boolForKey: @"InfoVisible"])
    437438        [self showInfo: nil];
     
    545546    //save history and stop running torrents
    546547    [self updateTorrentHistory];
     548   
     549    //make sure torrent is closed
     550    enumerator = [fTorrents objectEnumerator];
     551    Torrent * torrent;
     552    while ((torrent = [enumerator nextObject]))
     553        [torrent closeTorrent];
     554   
    547555    [fDisplayedTorrents removeAllObjects];
    548556    [fTorrents removeAllObjects];
     
    11481156            lowestOrderValue = currentOrderValue;
    11491157       
    1150         [torrent removeTorrent];
     1158        [torrent closeRemoveTorrent];
    11511159        [fTorrents removeObject: torrent];
    11521160        [fDisplayedTorrents removeObject: torrent];
     
    17011709   
    17021710    NSString * filterType = [fDefaults stringForKey: @"Filter"];
    1703     BOOL filtering = ![filterType isEqualToString: @"None"];
    17041711   
    17051712    int downloading = 0, seeding = 0, paused = 0;
     
    17071714            isSeeding = [filterType isEqualToString: @"Seed"],
    17081715            isPaused = [filterType isEqualToString: @"Pause"];
     1716    BOOL filtering = isDownloading || isSeeding || isPaused;
    17091717   
    17101718    //get count of each type
  • trunk/macosx/Torrent.h

    r2255 r2262  
    7676- (NSDictionary *) history;
    7777
    78 - (void) removeTorrent;
     78- (void) closeTorrent;
     79- (void) closeRemoveTorrent;
    7980
    8081- (void) changeIncompleteDownloadFolder: (NSString *) folder;
  • trunk/macosx/Torrent.m

    r2255 r2262  
    193193- (void) dealloc
    194194{
     195    # warning cleanup
    195196    if (fHandle)
    196197    {
    197         tr_torrentClose(fHandle);
    198        
    199198        if (fDownloadFolder)
    200199            [fDownloadFolder release];
     
    232231}
    233232
    234 - (void) removeTorrent
     233- (void) closeTorrent
     234{
     235    tr_torrentClose(fHandle);
     236}
     237
     238- (void) closeRemoveTorrent
    235239{
    236240    tr_torrentRemoveSaved(fHandle);
     241    [self closeTorrent];
    237242}
    238243
     
    14981503    }
    14991504   
    1500     #warning duplicate warning?
    15011505    NSString * currentDownloadFolder;
    15021506    tr_info_t info;
Note: See TracChangeset for help on using the changeset viewer.