Skip to content

Commit

Permalink
Fix an issue where state change notifications can be sent mulitple ti…
Browse files Browse the repository at this point in the history
…mes. (#1372)

Before the change: both - (void)setShouldInvertStrongReference:(BOOL)shouldInvertStrongReference and - (void)setNode:(ASDisplayNode *)node will call through [self setupReferencesWithNode:node]; which call the [node addInterfaceStateDelegate:self];
  • Loading branch information
wiseoldduck authored and Adlai-Holler committed Mar 8, 2019
1 parent d7eda2e commit aeb370f
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion Source/ASNodeController+Beta.mm
Original file line number Diff line number Diff line change
Expand Up @@ -50,13 +50,16 @@ - (void)setupReferencesWithNode:(ASDisplayNode *)node
}

[node __setNodeController:self];
[node addInterfaceStateDelegate:self];
}

- (void)setNode:(ASDisplayNode *)node
{
ASLockScopeSelf();
if (node == _node) {
return;
}
[self setupReferencesWithNode:node];
[node addInterfaceStateDelegate:self];
}

- (void)setShouldInvertStrongReference:(BOOL)shouldInvertStrongReference
Expand Down

0 comments on commit aeb370f

Please sign in to comment.