Commit 18d347fe authored by ColdPaleLight's avatar ColdPaleLight

fix #625 on v1.12.13-hotfixes

parent 9961047f
...@@ -26,6 +26,7 @@ ...@@ -26,6 +26,7 @@
#import "FlutterBoost.h" #import "FlutterBoost.h"
#import "FLBFlutterContainerManager.h" #import "FLBFlutterContainerManager.h"
#import "FLBFlutterEngine.h" #import "FLBFlutterEngine.h"
#import "FLBFlutterViewContainer.h"
@interface FLBFlutterApplication() @interface FLBFlutterApplication()
@property (nonatomic,strong) FLBFlutterContainerManager *manager; @property (nonatomic,strong) FLBFlutterContainerManager *manager;
...@@ -231,7 +232,8 @@ ...@@ -231,7 +232,8 @@
NSString *oldName = params[@"oldName"]; NSString *oldName = params[@"oldName"];
NSString *newName = params[@"newName"]; NSString *newName = params[@"newName"];
if (oldName!=nil && [newName isEqualToString:@"default"]) { if (oldName!=nil && [newName isEqualToString:@"default"]) {
[self.flutterProvider detach]; FLBFlutterViewContainer *viewController = (FLBFlutterViewContainer *)self.flutterProvider.engine.viewController;
[viewController surfaceUpdated:NO];
} }
} }
......
...@@ -118,10 +118,6 @@ ...@@ -118,10 +118,6 @@
if(!_name && name){ if(!_name && name){
_name = name; _name = name;
_params = params; _params = params;
[BoostMessageChannel didInitPageContainer:^(NSNumber *r) {}
pageName:name
params:params
uniqueId:[self uniqueIDString]];
} }
} }
...@@ -160,9 +156,28 @@ static NSUInteger kInstanceCounter = 0; ...@@ -160,9 +156,28 @@ static NSUInteger kInstanceCounter = 0;
[self.class instanceCounterIncrease]; [self.class instanceCounterIncrease];
} }
- (void)willMoveToParentViewController:(UIViewController *)parent {
if (parent) {
[BoostMessageChannel didInitPageContainer:^(NSNumber *r) {}
pageName:_name
params:_params
uniqueId:[self uniqueIDString]];
}
}
- (void)didMoveToParentViewController:(UIViewController *)parent {
if (!parent) {
[self notifyWillDealloc];
}
}
- (void)dismissViewControllerAnimated:(BOOL)flag completion:(void (^)(void))completion {
[self notifyWillDealloc];
[super dismissViewControllerAnimated:flag completion:completion];
}
- (void)dealloc - (void)dealloc
{ {
[self notifyWillDealloc];
[NSNotificationCenter.defaultCenter removeObserver:self]; [NSNotificationCenter.defaultCenter removeObserver:self];
} }
...@@ -262,11 +277,11 @@ static NSUInteger kInstanceCounter = 0; ...@@ -262,11 +277,11 @@ static NSUInteger kInstanceCounter = 0;
pageName:_name pageName:_name
params:_params params:_params
uniqueId:self.uniqueIDString]; uniqueId:self.uniqueIDString];
//如果当前不可见vc和engine所持有的vc一致。在FlutterVC在混合栈中是最后一张页面,如tab中的页面 // 如果当前不可见vc和engine所持有的vc一致。在FlutterVC在混合栈中是最后一张页面,如tab中的页面
// if (self == FLUTTER_VC) // if (self == FLUTTER_VC)
// { // {
// [self surfaceUpdated:NO]; // [self surfaceUpdated:NO];
// } // }
[super bridge_viewDidDisappear:animated]; [super bridge_viewDidDisappear:animated];
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment