Commit bfb71ebd authored by justin's avatar justin

Merge branch 'v1.12.13-hotfixes'

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