➜flutter doctor
Doctor summary (to see all details, run flutter doctor -v):
[✓] Flutter (Channel stable, v1.7.8+hotfix.4, on Mac OS X 10.14.5 18F203,
locale zh-Hans-CN)
[✓] Android toolchain - develop for Android devices (Android SDK version
29.0.0)
[✓] Xcode - develop for iOS and macOS (Xcode 11.1)
[✓] iOS tools - develop for iOS devices
[✓] Android Studio (version 3.4)
[✓] IntelliJ IDEA Ultimate Edition (version 2019.1.3)
[✓] VS Code (version 1.39.2)
[✓] Connected device (1 available)
• No issues found!
As we all know, the engine will free memory when I call destroyContext. But after the calling, some platform messages which were sent from Dart code cannot be received by native code, handleMethodCall won't be called.
So there is a serious problem. Some plugins need to do something after the dealloc calling. For example, "video_player" plugin will remove observer of the player's KVO. After calling destroyContext, the message "dispose" won't be received. And the KVO's observer won't be removed, the app will crash.
What is the suitable time to call the destroyContext on iOS?
➜flutter doctor Doctor summary (to see all details, run flutter doctor -v): [✓] Flutter (Channel stable, v1.7.8+hotfix.4, on Mac OS X 10.14.5 18F203, locale zh-Hans-CN) [✓] Android toolchain - develop for Android devices (Android SDK version 29.0.0) [✓] Xcode - develop for iOS and macOS (Xcode 11.1) [✓] iOS tools - develop for iOS devices [✓] Android Studio (version 3.4) [✓] IntelliJ IDEA Ultimate Edition (version 2019.1.3) [✓] VS Code (version 1.39.2) [✓] Connected device (1 available) • No issues found!As we all know, the engine will free memory when I call
destroyContext. But after the calling, some platform messages which were sent from Dart code cannot be received by native code,handleMethodCallwon't be called.So there is a serious problem. Some plugins need to do something after the
dealloccalling. For example, "video_player" plugin will remove observer of the player's KVO. After callingdestroyContext, the message "dispose" won't be received. And the KVO's observer won't be removed, the app will crash.What is the suitable time to call the destroyContext on iOS?