Skip to content

Commit

Permalink
Fix infinite loop whenever trying to draw anything.
Browse files Browse the repository at this point in the history
Honestly no clue how this ever worked before. Maybe there was a slight delay in the processing and that is gone now?
  • Loading branch information
cochrane committed Jun 15, 2019
1 parent 3fa1ae5 commit 57cda6c
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions GLLara/GLLSceneDrawer.m
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,9 @@ - (void)observeValueForKeyPath:(NSString *)keyPath ofObject:(id)object change:(N
{
if ([keyPath isEqual:@"needsRedraw"])
{
[self _notifyRedraw];
if ([change[NSKeyValueChangeNewKey] boolValue]) {
[self _notifyRedraw];
}
}
else
{
Expand Down Expand Up @@ -216,7 +218,7 @@ - (void)_addDrawerForItem:(GLLItem *)item;
}

[itemDrawers addObject:drawer];
[drawer addObserver:self forKeyPath:@"needsRedraw" options:0 context:0];
[drawer addObserver:self forKeyPath:@"needsRedraw" options:NSKeyValueObservingOptionNew context:0];
}
- (void)_unregisterDrawer:(GLLItemDrawer *)drawer
{
Expand Down

0 comments on commit 57cda6c

Please sign in to comment.