Browse Source

fix for #877,878,880

Daniel Zlotin 7 years ago
parent
commit
3b63f64a08

+ 12
- 1
ios/RNNRootViewController.m View File

36
 }
36
 }
37
 
37
 
38
 /**
38
 /**
39
- *	fix for #877
39
+ *	fix for #877, #878
40
  */
40
  */
41
 -(void)onJsReload {
41
 -(void)onJsReload {
42
+	[self cleanReactLeftovers];
43
+}
44
+
45
+/**
46
+ * fix for #880
47
+ */
48
+-(void)dealloc {
49
+	[self cleanReactLeftovers];
50
+}
51
+
52
+-(void)cleanReactLeftovers {
42
 	[[NSNotificationCenter defaultCenter] removeObserver:self];
53
 	[[NSNotificationCenter defaultCenter] removeObserver:self];
43
 	[[NSNotificationCenter defaultCenter] removeObserver:self.view];
54
 	[[NSNotificationCenter defaultCenter] removeObserver:self.view];
44
 	self.view = nil;
55
 	self.view = nil;

+ 0
- 22
ios/ReactNativeNavigation.m View File

79
 # pragma mark - js events
79
 # pragma mark - js events
80
 
80
 
81
 -(void)onJavaScriptWillLoad {
81
 -(void)onJavaScriptWillLoad {
82
-	[self releaseBeforeJSReload];
83
 	[_store clean];
82
 	[_store clean];
84
 }
83
 }
85
 
84
 
105
 											   object:nil];
104
 											   object:nil];
106
 }
105
 }
107
 
106
 
108
--(void)releaseBeforeJSReload {
109
-#ifdef DEBUG
110
-//	if(![UIApplication.sharedApplication.delegate.window.rootViewController isKindOfClass:[RNNSplashScreen class]]) {
111
-//		[self releaseBeforeJsReload:UIApplication.sharedApplication.delegate.window.rootViewController];
112
-//	}
113
-#endif
114
-}
115
-
116
-//-(void)releaseBeforeJsReload:(UIViewController*)vc {
117
-//	if(!vc) return;
118
-//	
119
-//	for (UIViewController* child in vc.childViewControllers) {
120
-//		[self releaseBeforeJsReload:child];
121
-//	}
122
-//	[self releaseBeforeJsReload:vc.presentedViewController];
123
-//	
124
-//	[NSNotificationCenter.defaultCenter removeObserver:vc];
125
-//	[NSNotificationCenter.defaultCenter removeObserver:vc.view];
126
-//	vc.view = nil;
127
-//}
128
-
129
 @end
107
 @end

+ 1
- 6
playground/src/containers/ModalScreen.js View File

69
   }
69
   }
70
 
70
 
71
   onClickDismissAllModals() {
71
   onClickDismissAllModals() {
72
-    // Navigation.dismissAllModals();
73
-    Navigation.setRoot({
74
-      container: {
75
-        name: 'navigation.playground.WelcomeScreen'
76
-      }
77
-    });
72
+    Navigation.dismissAllModals();
78
   }
73
   }
79
 
74
 
80
   getModalPosition() {
75
   getModalPosition() {