Ignore:
Timestamp:
Feb 11, 2012, 5:13:46 AM (10 years ago)
Author:
livings124
Message:

replace NSAutoreleasePool objects with @autoreleasepool blocks

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/macosx/Torrent.m

    r13187 r13219  
    6868void completenessChangeCallback(tr_torrent * torrent, tr_completeness status, bool wasRunning, void * torrentData)
    6969{
    70     NSAutoreleasePool * pool = [[NSAutoreleasePool alloc] init];
    71    
    72     NSDictionary * dict = [[NSDictionary alloc] initWithObjectsAndKeys: [NSNumber numberWithInt: status], @"Status",
    73                             [NSNumber numberWithBool: wasRunning], @"WasRunning", nil];
    74     [(Torrent *)torrentData performSelectorOnMainThread: @selector(completenessChange:) withObject: dict waitUntilDone: NO];
    75    
    76     [pool drain];
     70    @autoreleasepool
     71    {
     72        NSDictionary * dict = [[NSDictionary alloc] initWithObjectsAndKeys: [NSNumber numberWithInt: status], @"Status",
     73                               [NSNumber numberWithBool: wasRunning], @"WasRunning", nil];
     74        [(Torrent *)torrentData performSelectorOnMainThread: @selector(completenessChange:) withObject: dict waitUntilDone: NO];
     75    }
    7776}
    7877
     
    9493int trashDataFile(const char * filename)
    9594{
    96     NSAutoreleasePool * pool = [[NSAutoreleasePool alloc] init];
    97    
    98     if (filename != NULL)
    99         [Torrent trashFile: [NSString stringWithUTF8String: filename]];
    100    
    101     [pool drain];
     95    @autoreleasepool
     96    {
     97        if (filename != NULL)
     98            [Torrent trashFile: [NSString stringWithUTF8String: filename]];
     99    }
    102100    return 0;
    103101}
Note: See TracChangeset for help on using the changeset viewer.