call method channel destroyContext on Windows

This commit is contained in:
Nick Fisher
2025-04-02 22:28:47 +08:00
parent 854b142973
commit cf372f4dc2

View File

@@ -98,7 +98,9 @@ class ThermionFlutterMethodChannelPlatform extends ThermionFlutterPlatform {
if (FilamentApp.instance == null) {
await FFIFilamentApp.create(config: config);
FilamentApp.instance!.onDestroy(() async {
await channel.invokeMethod("destroyContext");
if(Platform.isWindows) {
await channel.invokeMethod("destroyContext");
}
_swapChain = null;
});
}