mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2026-01-03 11:44:46 +00:00
Merge pull request #1026 from 1nput0utput/ASControlNodeMutationCrash
[ASControlNode] Copy event table before calling action methods, as they may trigger action removal.
This commit is contained in:
@@ -339,7 +339,8 @@ void _ASEnumerateControlEventsIncludedInMaskWithBlock(ASControlNodeEvent mask, v
|
||||
_ASEnumerateControlEventsIncludedInMaskWithBlock(controlEvents, ^
|
||||
(ASControlNodeEvent controlEvent)
|
||||
{
|
||||
NSMapTable *eventDispatchTable = [_controlEventDispatchTable objectForKey:_ASControlNodeEventKeyForControlEvent(controlEvent)];
|
||||
// Use a copy to itereate, the action perform could call remove causing a mutation crash.
|
||||
NSMapTable *eventDispatchTable = [[_controlEventDispatchTable objectForKey:_ASControlNodeEventKeyForControlEvent(controlEvent)] copy];
|
||||
|
||||
// For each target interested in this event...
|
||||
for (id target in eventDispatchTable)
|
||||
|
||||
Reference in New Issue
Block a user