#3851 use an autorelease pool when the completeness callback is called; revert the unnecessary r11607
This commit is contained in:
parent
a17962d5fc
commit
20cdf0162a
|
@ -1911,8 +1911,6 @@ static void sleepCallback(void * controller, io_service_t y, natural_t messageTy
|
||||||
|
|
||||||
- (void) torrentFinishedDownloading: (NSNotification *) notification
|
- (void) torrentFinishedDownloading: (NSNotification *) notification
|
||||||
{
|
{
|
||||||
NSAutoreleasePool * pool = [[NSAutoreleasePool alloc] init];
|
|
||||||
|
|
||||||
Torrent * torrent = [notification object];
|
Torrent * torrent = [notification object];
|
||||||
|
|
||||||
if ([[[notification userInfo] objectForKey: @"WasRunning"] boolValue])
|
if ([[[notification userInfo] objectForKey: @"WasRunning"] boolValue])
|
||||||
|
@ -1953,14 +1951,10 @@ static void sleepCallback(void * controller, io_service_t y, natural_t messageTy
|
||||||
}
|
}
|
||||||
|
|
||||||
[self updateTorrentsInQueue];
|
[self updateTorrentsInQueue];
|
||||||
|
|
||||||
[pool drain];
|
|
||||||
}
|
}
|
||||||
|
|
||||||
- (void) torrentRestartedDownloading: (NSNotification *) notification
|
- (void) torrentRestartedDownloading: (NSNotification *) notification
|
||||||
{
|
{
|
||||||
NSAutoreleasePool * pool = [[NSAutoreleasePool alloc] init];
|
|
||||||
|
|
||||||
Torrent * torrent = [notification object];
|
Torrent * torrent = [notification object];
|
||||||
if ([torrent isActive] && [fDefaults boolForKey: @"Queue"] && [self numToStartFromQueue: YES] == 0)
|
if ([torrent isActive] && [fDefaults boolForKey: @"Queue"] && [self numToStartFromQueue: YES] == 0)
|
||||||
{
|
{
|
||||||
|
@ -1969,14 +1963,10 @@ static void sleepCallback(void * controller, io_service_t y, natural_t messageTy
|
||||||
}
|
}
|
||||||
|
|
||||||
[self updateTorrentsInQueue];
|
[self updateTorrentsInQueue];
|
||||||
|
|
||||||
[pool drain];
|
|
||||||
}
|
}
|
||||||
|
|
||||||
- (void) torrentFinishedSeeding: (NSNotification *) notification
|
- (void) torrentFinishedSeeding: (NSNotification *) notification
|
||||||
{
|
{
|
||||||
NSAutoreleasePool * pool = [[NSAutoreleasePool alloc] init];
|
|
||||||
|
|
||||||
Torrent * torrent = [notification object];
|
Torrent * torrent = [notification object];
|
||||||
|
|
||||||
[self updateTorrentsInQueue];
|
[self updateTorrentsInQueue];
|
||||||
|
@ -2007,8 +1997,6 @@ static void sleepCallback(void * controller, io_service_t y, natural_t messageTy
|
||||||
[GrowlApplicationBridge notifyWithTitle: NSLocalizedString(@"Seeding Complete", "Growl notification title")
|
[GrowlApplicationBridge notifyWithTitle: NSLocalizedString(@"Seeding Complete", "Growl notification title")
|
||||||
description: [torrent name] notificationName: GROWL_SEEDING_COMPLETE
|
description: [torrent name] notificationName: GROWL_SEEDING_COMPLETE
|
||||||
iconData: nil priority: 0 isSticky: NO clickContext: clickContext];
|
iconData: nil priority: 0 isSticky: NO clickContext: clickContext];
|
||||||
|
|
||||||
[pool drain];
|
|
||||||
}
|
}
|
||||||
|
|
||||||
- (void) updateTorrentHistory
|
- (void) updateTorrentHistory
|
||||||
|
|
|
@ -62,9 +62,13 @@
|
||||||
|
|
||||||
void completenessChangeCallback(tr_torrent * torrent, tr_completeness status, tr_bool wasRunning, void * torrentData)
|
void completenessChangeCallback(tr_torrent * torrent, tr_completeness status, tr_bool wasRunning, void * torrentData)
|
||||||
{
|
{
|
||||||
|
NSAutoreleasePool * pool = [[NSAutoreleasePool alloc] init];
|
||||||
|
|
||||||
NSDictionary * dict = [[NSDictionary alloc] initWithObjectsAndKeys: [NSNumber numberWithInt: status], @"Status",
|
NSDictionary * dict = [[NSDictionary alloc] initWithObjectsAndKeys: [NSNumber numberWithInt: status], @"Status",
|
||||||
[NSNumber numberWithBool: wasRunning], @"WasRunning", nil];
|
[NSNumber numberWithBool: wasRunning], @"WasRunning", nil];
|
||||||
[(Torrent *)torrentData performSelectorOnMainThread: @selector(completenessChange:) withObject: dict waitUntilDone: NO];
|
[(Torrent *)torrentData performSelectorOnMainThread: @selector(completenessChange:) withObject: dict waitUntilDone: NO];
|
||||||
|
|
||||||
|
[pool drain];
|
||||||
}
|
}
|
||||||
|
|
||||||
void ratioLimitHitCallback(tr_torrent * torrent, void * torrentData)
|
void ratioLimitHitCallback(tr_torrent * torrent, void * torrentData)
|
||||||
|
|
Loading…
Reference in New Issue