This content has been marked as final. Show 3 replies
Bump, because this issue is still around, and I cannot find a fix for it.
You're doing a couple of strange things here:
- Calling preventDefault on the CLOSING event. That prevents the window from being closed. Since you're supposedly trying to exit, why keep the window open? I believe this is interrupting the shutdown sequence.
- If you want to do something on exit, you should be listening for EXITING, not CLOSING.
- If you want a button that quits the app, it should call exit(), not dispatch a CLOSING event.
- If you want a button that closes a window, it should call close(), not dispatch closing().
Finally, the application menu item and Cmd-Q work correctly by default. Adding event handlers, etc. for these events is only necessary if you want to override the default behavior.
Thanks for your insights.