Changeset 6241


Ignore:
Timestamp:
Jun 21, 2008, 5:44:01 PM (13 years ago)
Author:
livings124
Message:

attempt to fix #1048

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/macosx/Controller.m

    r6233 r6241  
    15831583   
    15841584    //sort torrents by order value
     1585    NSArray * sortedTorrents; //can't just resort fTorrents because it might be rearranged while enumerating because of recursion
    15851586    if ([fTorrents count] > 1 && (desiredDownloadActive > 0 || desiredSeedActive > 0))
    15861587    {
    15871588        NSSortDescriptor * orderDescriptor = [[[NSSortDescriptor alloc] initWithKey: @"orderValue" ascending: YES] autorelease];
    1588         [fTorrents sortUsingDescriptors: [NSArray arrayWithObject: orderDescriptor]];
    1589     }
     1589        sortedTorrents = [fTorrents sortedArrayUsingDescriptors: [NSArray arrayWithObject: orderDescriptor]];
     1590    }
     1591    else
     1592        sortedTorrents = fTorrents;
    15901593   
    15911594    Torrent * torrent;
    1592     NSEnumerator * enumerator = [fTorrents objectEnumerator];
     1595    NSEnumerator * enumerator = [sortedTorrents objectEnumerator];
    15931596    while ((torrent = [enumerator nextObject]))
    15941597    {
Note: See TracChangeset for help on using the changeset viewer.