Skip to content

Commit 8dbcb2d

Browse files
yogevbdYogev Ben David
andcommitted
Remove yellowBox observer on dealloc (#7015)
This PR fixes a crash caused by a KVO observer that isn't cleared. Closes #7009 Co-authored-by: Yogev Ben David <[email protected]>
1 parent f86299a commit 8dbcb2d

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

lib/ios/RNNComponentView.m

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,14 @@ - (void)observeValueForKeyPath:(NSString *)keyPath
4444
}
4545
}
4646
}
47+
48+
- (void)dealloc {
49+
if (_observeLayerChange) {
50+
[self.subviews.firstObject.subviews.firstObject.layer removeObserver:self
51+
forKeyPath:@"sublayers"];
52+
}
53+
}
54+
4755
#endif
4856

4957
@end

0 commit comments

Comments
 (0)