#6022: Prevent stack overflow when stallness changes for lots of torrents at the same time

This commit is contained in:
Mike Gelfand 2015-11-25 21:53:26 +00:00
parent 74129b7ef3
commit d4232cf08b
1 changed files with 6 additions and 2 deletions

View File

@ -325,8 +325,12 @@ bool trashDataFile(const char * filename, tr_error ** error)
//make sure the "active" filter is updated when stalled-ness changes
if (wasStalled != [self isStalled])
[[NSNotificationCenter defaultCenter] postNotificationName: @"UpdateQueue" object: self];
//posting asynchronously with coalescing to prevent stack overflow on lots of torrents changing state at the same time
[[NSNotificationQueue defaultQueue] enqueueNotification: [NSNotification notificationWithName: @"UpdateQueue" object: self]
postingStyle: NSPostASAP
coalesceMask: NSNotificationCoalescingOnName
forModes: nil];
//when the torrent is first loaded, update the time machine exclusion
if (!fTimeMachineExcludeInitialized)
[self updateTimeMachineExclude];