Commit bfb71ebd authored by justin's avatar justin

Merge branch 'v1.12.13-hotfixes'

parents 6d98bca6 bdcc488e
......@@ -69,6 +69,7 @@
@property (nonatomic,assign) long long identifier;
@property (nonatomic, copy) NSString *flbNibName;
@property (nonatomic, strong) NSBundle *flbNibBundle;
@property (nonatomic, assign) BOOL deallocNotified;
@end
#pragma clang diagnostic push
......@@ -163,6 +164,7 @@ static NSUInteger kInstanceCounter = 0;
pageName:_name
params:_params
uniqueId:[self uniqueIDString]];
self.deallocNotified = NO;
}
[super willMoveToParentViewController:parent];
}
......@@ -171,23 +173,29 @@ static NSUInteger kInstanceCounter = 0;
if (!parent) {
//当VC被移出parent时,就通知flutter层销毁page
[self notifyWillDealloc];
self.deallocNotified = YES;
}
[super didMoveToParentViewController:parent];
}
- (void)dismissViewControllerAnimated:(BOOL)flag completion:(void (^)(void))completion {
__weak __typeof__(self) weakSelf = self;
[super dismissViewControllerAnimated:flag completion:^(){
__strong __typeof__(weakSelf) self = weakSelf;
if (completion) {
completion();
}
//当VC被dismiss时,就通知flutter层销毁page
[self notifyWillDealloc];
self.deallocNotified = YES;
}];
}
- (void)dealloc
{
if (!self.deallocNotified) {
[self notifyWillDealloc];
}
[NSNotificationCenter.defaultCenter removeObserver:self];
}
......
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