Skip to content

Windows "application has stopped responding" on close #19

@driftwoodstudio

Description

@driftwoodstudio

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions