Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions ios/Classes/FlutterBoostPlugin.h
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ typedef void (^FBVoidCallback)(void);
- (void)containerDisappeared:(id<FBFlutterContainer>)container;
- (void)containerDestroyed:(id<FBFlutterContainer>)container;
- (void)onBackSwipe;
- (void)removeContainerWhenDealloc:(id<FBFlutterContainer>)container;

- (FBVoidCallback)addEventListener:(FBEventListener)listener forName:(NSString *)key;
+ (FlutterBoostPlugin* )getPlugin:(FlutterEngine*)engine ;
Expand Down
11 changes: 7 additions & 4 deletions ios/Classes/FlutterBoostPlugin.m
Original file line number Diff line number Diff line change
Expand Up @@ -85,10 +85,13 @@ - (void)containerDestroyed:(id<FBFlutterContainer>)vc {
[self.flutterApi removeRouteParam:params
completion:^(NSError * e) {
}];
[self.containerManager removeContainerByUniqueId:vc.uniqueIDString];
if (self.containerManager.containerSize == 0) {
[FBLifecycle pause];
}
}

- (void)removeContainerWhenDealloc:(id<FBFlutterContainer>)container {
[self.containerManager removeContainerByUniqueId:container.uniqueIDString];
if (self.containerManager.containerSize == 0) {
[FBLifecycle pause];
}
}

+ (void)registerWithRegistrar:(NSObject<FlutterPluginRegistrar> *)registrar {
Expand Down
1 change: 1 addition & 0 deletions ios/Classes/container/FBFlutterViewContainer.m
Original file line number Diff line number Diff line change
Expand Up @@ -204,6 +204,7 @@ - (void)dealloc {
if (self.removeEventCallback != nil) {
self.removeEventCallback();
}
[FB_PLUGIN removeContainerWhenDealloc:self];
[NSNotificationCenter.defaultCenter removeObserver:self];
_leftEdgeGesture.delegate = nil;
}
Expand Down