浏览代码

Prevent retaining overlay RootView in rotation block

yogevbd 7 年前
父节点
当前提交
abb91113ea
共有 2 个文件被更改,包括 2 次插入3 次删除
  1. 2
    2
      lib/ios/RNNControllerFactory.m
  2. 0
    1
      lib/ios/RNNRootViewController.m

+ 2
- 2
lib/ios/RNNControllerFactory.m 查看文件

190
 
190
 
191
 - (UIViewController<RNNRootViewProtocol> *)createOverlay:(NSDictionary*)layout {
191
 - (UIViewController<RNNRootViewProtocol> *)createOverlay:(NSDictionary*)layout {
192
 	UIViewController<RNNRootViewProtocol> *vc = [self fromTree:layout];
192
 	UIViewController<RNNRootViewProtocol> *vc = [self fromTree:layout];
193
-	RCTRootView* rootView = (RCTRootView*)vc.view;
193
+	__block RCTRootView* rootView = (RCTRootView*)vc.view;
194
 	[vc performOnRotation:^{
194
 	[vc performOnRotation:^{
195
 		CGSize availableSize = UIApplication.sharedApplication.delegate.window.bounds.size;
195
 		CGSize availableSize = UIApplication.sharedApplication.delegate.window.bounds.size;
196
-		[_bridge.uiManager setSize:availableSize forView:vc.view];
196
+		[_bridge.uiManager setSize:availableSize forView:rootView];
197
 	}];
197
 	}];
198
 	rootView.backgroundColor = [UIColor clearColor];
198
 	rootView.backgroundColor = [UIColor clearColor];
199
 	CGSize availableSize = UIApplication.sharedApplication.delegate.window.bounds.size;
199
 	CGSize availableSize = UIApplication.sharedApplication.delegate.window.bounds.size;

+ 0
- 1
lib/ios/RNNRootViewController.m 查看文件

68
 -(void)viewDidDisappear:(BOOL)animated {
68
 -(void)viewDidDisappear:(BOOL)animated {
69
 	[super viewDidDisappear:animated];
69
 	[super viewDidDisappear:animated];
70
 	[self.eventEmitter sendComponentDidDisappear:self.componentId componentName:self.componentName];
70
 	[self.eventEmitter sendComponentDidDisappear:self.componentId componentName:self.componentName];
71
-	_rotationBlock = nil;
72
 }
71
 }
73
 
72
 
74
 - (void)viewDidLoad {
73
 - (void)viewDidLoad {