-
Notifications
You must be signed in to change notification settings - Fork 14
Description
Is there a magical invocation to use to exit the app when when using this package?
Put another way: is there a specific proper way to exit the flutter app when using the "confirm on close" functionality?
I'm seeing a situation where sometimes it works, sometimes I get "application has stopped responding" windows error dialog when attempting to exit the application. This is happening because of an unhandled exeption in a windows .dll library.
I've tried various combinations of all of the following:
main.cpp:
window.SetQuitOnClose(false) and (true)
Flutter:
Navigator.of(context).pop();
await WindowManagerPlus.current.close();
await WindowManagerPlus.current.destroy();
I can't seem to find any combination of these that works reliably without producing the "application has stopped responding" outcome.
It doesn't seem to matter whether close process is initiated by
await WindowManagerPlus.current.close()
in a menu, or by the user clicking the Windows "close" button in the window title bar.
Initiating close triggers activation of my "confirm close" handler in my ... with WindowListener { class, and the close interceptor handler gets invoked and runs as expected.
However, once I determine that it's ok to close I'm trying to do that: end the flutter application. But I can't find any way to do this that doesn't often result in an unhandled exception being thrown in a windows .dll