Changeset 4266


Ignore:
Timestamp:
Dec 21, 2007, 8:39:43 PM (15 years ago)
Author:
livings124
Message:

fix an annoying crash

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/macosx/Controller.m

    r4264 r4266  
    11011101        {
    11021102            NSDictionary * dict = [[NSDictionary alloc] initWithObjectsAndKeys:
    1103                 torrents, @"Torrents",
    1104                 [NSNumber numberWithBool: deleteData], @"DeleteData",
    1105                 [NSNumber numberWithBool: deleteTorrent], @"DeleteTorrent", nil];
    1106 
     1103                                    torrents, @"Torrents",
     1104                                    [NSNumber numberWithBool: deleteData], @"DeleteData",
     1105                                    [NSNumber numberWithBool: deleteTorrent], @"DeleteTorrent", nil];
     1106           
    11071107            NSString * title, * message;
    11081108           
     
    11551155                                "Removal confirm panel -> message part 2")];
    11561156            }
    1157 
     1157           
    11581158            NSBeginAlertSheet(title, NSLocalizedString(@"Remove", "Removal confirm panel -> button"),
    11591159                NSLocalizedString(@"Cancel", "Removal confirm panel -> button"), nil, fWindow, self,
     
    11691169{
    11701170    NSArray * torrents = [dict objectForKey: @"Torrents"];
    1171     BOOL deleteData = [[dict objectForKey: @"DeleteData"] boolValue],
    1172         deleteTorrent = [[dict objectForKey: @"DeleteTorrent"] boolValue];
    1173     [dict release];
    1174    
    11751171    if (returnCode == NSAlertDefaultReturn)
    1176         [self confirmRemoveTorrents: torrents deleteData: deleteData deleteTorrent: deleteTorrent];
     1172        [self confirmRemoveTorrents: torrents deleteData: [[dict objectForKey: @"DeleteData"] boolValue]
     1173                                                deleteTorrent: [[dict objectForKey: @"DeleteTorrent"] boolValue]];
    11771174    else
    11781175        [torrents release];
     1176   
     1177    [dict release];
    11791178}
    11801179
     
    11861185    while ((torrent = [enumerator nextObject]))
    11871186        [torrent setWaitToStart: NO];
    1188 
     1187   
    11891188    int lowestOrderValue = -1, currentOrderValue;
    1190 
     1189   
     1190    [fTorrents removeObjectsInArray: torrents];
     1191    [fDisplayedTorrents removeObjectsInArray: torrents];
     1192   
    11911193    enumerator = [torrents objectEnumerator];
    11921194    while ((torrent = [enumerator nextObject]))
    11931195    {
    1194         [torrent stopTransfer];
    1195 
    11961196        if (deleteData)
    11971197            [torrent trashData];
     
    12051205       
    12061206        [torrent closeRemoveTorrent];
    1207         [fTorrents removeObject: torrent];
    1208         [fDisplayedTorrents removeObject: torrent];
    1209     }
     1207    }
     1208   
    12101209    [torrents release];
    12111210
     
    12271226    [fTableView deselectAll: nil];
    12281227   
    1229     [self updateUI];
    1230     [self applyFilter: nil];
    1231     [self updateTorrentHistory];
     1228    [self updateTorrentsInQueue];
    12321229}
    12331230
Note: See TracChangeset for help on using the changeset viewer.