Ignore:
Timestamp:
Jun 27, 2007, 12:42:06 AM (15 years ago)
Author:
livings124
Message:

reflect some of the changes in libT (some, which means it still doesn't compile ;))

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/macosx/Controller.m

    r2198 r2205  
    545545    //save history and stop running torrents
    546546    [self updateTorrentHistory];
    547     [fTorrents makeObjectsPerformSelector: @selector(stopTransferForQuit)];
     547    #warning check if all torrents are fully released
     548    [fDisplayedTorrents removeAllObjects];
     549    [fTorrents removeAllObjects];
    548550   
    549551    //disable NAT traversal
     
    559561    [fBadger clearBadge];
    560562
    561     //wait for running transfers to stop (5 second timeout)
     563    //wait for running transfers to stop and for NAT to be disabled (5 second timeout)
    562564    NSDate * start = [NSDate date];
    563     BOOL timeUp = NO;
    564    
    565     enumerator = [fTorrents objectEnumerator];
    566     Torrent * torrent;
    567     while (!timeUp && (torrent = [enumerator nextObject]))
    568         while (![torrent isPaused] && !(timeUp = [start timeIntervalSinceNow] < -5.0))
    569         {
    570             usleep(100000);
    571             [torrent update];
    572         }
    573    
    574     //wait for NAT to be disabled (same 5 second timeout)
    575     while (!([start timeIntervalSinceNow] < -5.0)
    576                 && tr_handleStatus(fLib)->natTraversalStatus != TR_NAT_TRAVERSAL_DISABLED)
     565    while ([start timeIntervalSinceNow] >= -5.0
     566            && (tr_torrentCount(fLib) > 0 || tr_handleStatus(fLib)->natTraversalStatus != TR_NAT_TRAVERSAL_DISABLED))
    577567        usleep(100000);
    578568}
     
    12081198    if (code == NSOKButton)
    12091199    {
    1210         //move torrent data file to new location
    12111200        NSEnumerator * enumerator = [torrents objectEnumerator];
    12121201        Torrent * torrent;
Note: See TracChangeset for help on using the changeset viewer.