Changeset 13611


Ignore:
Timestamp:
Nov 4, 2012, 7:28:51 PM (9 years ago)
Author:
livings124
Message:

#5121 Stopped torrents resume after sleep automatically.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/macosx/Controller.m

    r13608 r13611  
    44664466    {
    44674467        case kIOMessageSystemWillSleep:
     4468        {
     4469            //stop all transfers (since some are active) before going to sleep and remember to resume when we wake up
     4470            BOOL anyActive = NO;
     4471            for (Torrent * torrent in fTorrents)
     4472            {
     4473                if ([torrent isActive])
     4474                    anyActive = YES;
     4475                [torrent sleep]; //have to call on all, regardless if they are active
     4476            }
     4477           
    44684478            //if there are any running transfers, wait 15 seconds for them to stop
    4469             for (Torrent * torrent in fTorrents)
    4470                 if ([torrent isActive])
    4471                 {
    4472                     //stop all transfers (since some are active) before going to sleep and remember to resume when we wake up
    4473                     for (Torrent * torrent in fTorrents)
    4474                         [torrent sleep];
    4475                     sleep(15);
    4476                     break;
    4477                 }
    4478 
     4479            if (anyActive)
     4480            {
     4481                sleep(15);
     4482                break;
     4483            }
     4484           
    44794485            IOAllowPowerChange(fRootPort, (long) messageArgument);
    44804486            break;
     4487        }
    44814488
    44824489        case kIOMessageCanSystemSleep:
Note: See TracChangeset for help on using the changeset viewer.