Changeset 11613


Ignore:
Timestamp:
Dec 31, 2010, 1:25:03 AM (11 years ago)
Author:
livings124
Message:

#3851 use an autorelease pool when the completeness callback is called; revert the unnecessary r11607

Location:
trunk/macosx
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/macosx/Controller.m

    r11607 r11613  
    19121912- (void) torrentFinishedDownloading: (NSNotification *) notification
    19131913{
    1914     NSAutoreleasePool * pool = [[NSAutoreleasePool alloc] init];
    1915    
    19161914    Torrent * torrent = [notification object];
    19171915   
     
    19541952   
    19551953    [self updateTorrentsInQueue];
    1956    
    1957     [pool drain];
    19581954}
    19591955
    19601956- (void) torrentRestartedDownloading: (NSNotification *) notification
    19611957{
    1962     NSAutoreleasePool * pool = [[NSAutoreleasePool alloc] init];
    1963    
    19641958    Torrent * torrent = [notification object];
    19651959    if ([torrent isActive] && [fDefaults boolForKey: @"Queue"] && [self numToStartFromQueue: YES] == 0)
     
    19701964   
    19711965    [self updateTorrentsInQueue];
    1972    
    1973     [pool drain];
    19741966}
    19751967
    19761968- (void) torrentFinishedSeeding: (NSNotification *) notification
    19771969{
    1978     NSAutoreleasePool * pool = [[NSAutoreleasePool alloc] init];
    1979    
    19801970    Torrent * torrent = [notification object];
    19811971   
     
    20081998                        description: [torrent name] notificationName: GROWL_SEEDING_COMPLETE
    20091999                        iconData: nil priority: 0 isSticky: NO clickContext: clickContext];
    2010    
    2011     [pool drain];
    20122000}
    20132001
  • trunk/macosx/Torrent.m

    r11584 r11613  
    6363void completenessChangeCallback(tr_torrent * torrent, tr_completeness status, tr_bool wasRunning, void * torrentData)
    6464{
     65    NSAutoreleasePool * pool = [[NSAutoreleasePool alloc] init];
     66   
    6567    NSDictionary * dict = [[NSDictionary alloc] initWithObjectsAndKeys: [NSNumber numberWithInt: status], @"Status",
    6668                            [NSNumber numberWithBool: wasRunning], @"WasRunning", nil];
    6769    [(Torrent *)torrentData performSelectorOnMainThread: @selector(completenessChange:) withObject: dict waitUntilDone: NO];
     70   
     71    [pool drain];
    6872}
    6973
Note: See TracChangeset for help on using the changeset viewer.