Changeset 2774


Ignore:
Timestamp:
Aug 15, 2007, 10:27:05 PM (15 years ago)
Author:
livings124
Message:

fix a problem when adding multiple torrents with "always ask" enabled

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/0.8x/macosx/Controller.m

    r2759 r2774  
    814814    while ([files count] > 0)
    815815    {
    816         torrentPath = [files objectAtIndex: 0];
     816        torrentPath = [[files objectAtIndex: 0] retain];
    817817        canAdd = tr_torrentParse(fLib, [torrentPath UTF8String], NULL, &info);
    818818        if (canAdd == TR_OK)
     
    833833        return;
    834834    }
    835 
     835   
    836836    [files removeObjectAtIndex: 0];
     837   
    837838    NSOpenPanel * panel = [NSOpenPanel openPanel];
    838839
     
    845846    [panel setMessage: [NSString stringWithFormat: NSLocalizedString(@"Select the download folder for \"%@\"",
    846847                        "Open torrent -> select destination folder"), [NSString stringWithUTF8String: info.name]]];
    847    
    848     NSDictionary * dictionary = [[NSDictionary alloc] initWithObjectsAndKeys: [torrentPath retain], @"Path",
     848    tr_metainfoFree(&info);
     849   
     850    NSDictionary * dictionary = [[NSDictionary alloc] initWithObjectsAndKeys: torrentPath, @"Path",
    849851                                    files, @"Files", [NSNumber numberWithInt: deleteTorrent], @"DeleteTorrent", nil];
    850     tr_metainfoFree(&info);
     852    [torrentPath release];
    851853   
    852854    [panel beginSheetForDirectory: nil file: nil types: nil modalForWindow: fWindow modalDelegate: self
     
    872874    }
    873875   
     876    [openPanel close];
    874877    [self performSelectorOnMainThread: @selector(openFilesAskWithDict:) withObject: dictionary waitUntilDone: NO];
    875878}
Note: See TracChangeset for help on using the changeset viewer.