Skip to content

Commit

Permalink
Remove yellowBox observer on dealloc (#7015)
Browse files Browse the repository at this point in the history
This PR fixes a crash caused by a KVO observer that isn't cleared.

Closes #7009

Co-authored-by: Yogev Ben David <yogevbd@wixs-MacBook-Pro.local>
  • Loading branch information
yogevbd and Yogev Ben David committed Mar 9, 2021
1 parent f86299a commit 8dbcb2d
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions lib/ios/RNNComponentView.m
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,14 @@ - (void)observeValueForKeyPath:(NSString *)keyPath
}
}
}

- (void)dealloc {
if (_observeLayerChange) {
[self.subviews.firstObject.subviews.firstObject.layer removeObserver:self
forKeyPath:@"sublayers"];
}
}

#endif

@end

0 comments on commit 8dbcb2d

Please sign in to comment.