mirror of
https://github.com/facebook/react-native.git
synced 2025-11-01 09:14:26 +00:00
Attempt to fix undefined instance handle in EventTarget
Summary: changelog: [internal] Completion block can retain `_eventEmitter` beyond existence of the component. To fix this, do not retain `_eventEmitter` by block but try to acquire it inside it. Reviewed By: JoshuaGross Differential Revision: D29969189 fbshipit-source-id: 456c42f816acc160f9d6bbd3f9c8c55d611940b2
This commit is contained in:
committed by
Facebook GitHub Bot
parent
dc8d218077
commit
f592ad0509
@@ -171,12 +171,11 @@ static ModalHostViewEventEmitter::OnOrientationChange onOrientationChangeStruct(
|
||||
UIView *snapshot = _modalContentsSnapshot;
|
||||
[self.viewController.view addSubview:snapshot];
|
||||
|
||||
auto eventEmitter = [self modalEventEmitter];
|
||||
[self dismissViewController:self.viewController
|
||||
animated:_shouldAnimatePresentation
|
||||
completion:^{
|
||||
[snapshot removeFromSuperview];
|
||||
|
||||
auto eventEmitter = [self modalEventEmitter];
|
||||
if (eventEmitter) {
|
||||
eventEmitter->onDismiss(ModalHostViewEventEmitter::OnDismiss{});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user