You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When my Tauri application exits, I need to perform some cleanup. I've found that I can use WindowEvent::CloseRequested, WindowEvent::Destroyed, or RunEvent::ExitRequested to perform cleanup when the main window is closed. However, if the user selects MenuItem::Quit, the Tauri application exits immediately (exit_app, which simply calls exit(0)).
Given that many users routinely terminate applications with MenuItem::Quit (it is often the norm on Macs, for instance), the lack of any event to allow cleanup results in leaks (e.g., processes that may not be closed and other cleanup needed).
Note that 'Quit' is considered different, semantically, from 'Force Quit.' The current behavior seems more appropriate for a 'Force Quit.'
Describe the solution you'd like
When MenuItem::Quit is selected, RunEvent::ExitRequested should be emitted. If the main window is closed as a result of MenuItem::Quit, the relevant WindowEvents should be emitted (e.g., CloseRequested, Destroyed).
Describe the problem
When my Tauri application exits, I need to perform some cleanup. I've found that I can use WindowEvent::CloseRequested, WindowEvent::Destroyed, or RunEvent::ExitRequested to perform cleanup when the main window is closed. However, if the user selects MenuItem::Quit, the Tauri application exits immediately (exit_app, which simply calls exit(0)).
Given that many users routinely terminate applications with MenuItem::Quit (it is often the norm on Macs, for instance), the lack of any event to allow cleanup results in leaks (e.g., processes that may not be closed and other cleanup needed).
Note that 'Quit' is considered different, semantically, from 'Force Quit.' The current behavior seems more appropriate for a 'Force Quit.'
Describe the solution you'd like
When MenuItem::Quit is selected, RunEvent::ExitRequested should be emitted. If the main window is closed as a result of MenuItem::Quit, the relevant WindowEvents should be emitted (e.g., CloseRequested, Destroyed).
Alternatives considered
No response
Additional context
I noticed a previous bug filed for this issue, but it seems it was deemed not possible at the time.
The text was updated successfully, but these errors were encountered: