Skip to content

Commit 0711afd

Browse files
committed
fix crash when killing app on iOS
1 parent 5ec7307 commit 0711afd

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

darwin/Classes/FvpPlugin.mm

+5
Original file line numberDiff line numberDiff line change
@@ -135,6 +135,7 @@ + (void)registerWithRegistrar:(NSObject<FlutterPluginRegistrar>*)registrar {
135135
#endif
136136
FlutterMethodChannel* channel = [FlutterMethodChannel methodChannelWithName:@"fvp" binaryMessenger:messenger];
137137
FvpPlugin* instance = [[FvpPlugin alloc] initWithRegistrar:registrar];
138+
[registrar addApplicationDelegate:instance];
138139
[registrar publish:instance];
139140
[registrar addMethodCallDelegate:instance channel:channel];
140141
SetGlobalOption("MDK_KEY", "C03BFF5306AB39058A767105F82697F42A00FE970FB0E641D306DEFF3F220547E5E5377A3C504DC30D547890E71059BC023A4DD91A95474D1F33CA4C26C81B0FC73B00ACF954C6FA75898EFA07D9680B6A00FDF179C0A15381101D01124498AF55B069BD4B0156D5CF5A56DEDE782E5F3930AD47C8F40BFBA379231142E31B0F");
@@ -183,4 +184,8 @@ - (void)handleMethodCall:(FlutterMethodCall*)call result:(FlutterResult)result {
183184
- (void)detachFromEngineForRegistrar:(NSObject<FlutterPluginRegistrar> *)registrar {
184185
players.clear();
185186
}
187+
188+
- (void)applicationWillTerminate:(UIApplication *)application {
189+
players.clear();
190+
}
186191
@end

0 commit comments

Comments
 (0)