mirror of
https://github.com/usebruno/bruno.git
synced 2026-06-23 20:55:41 +00:00
* fix: app crash on clicking close button \n Added collection, workspace, and api spec watcher cleanup on app close method
* fix: close file watchers before app exit to prevent crash on macOS
Close all chokidar file watchers (collection, workspace, apiSpec) before
the Node environment is torn down. The native FSEvents watchers run on
their own threads and their cleanup races with FreeEnvironment, causing
an abort when fse_instance_destroy tries to lock a destroyed mutex.
Watchers are closed in both mainWindow.on('close') and app.on('before-quit')
to cover the native close button path and the app.exit() path.
* fix: move watcher cleanup from close handler to before-quit only
The close event is cancelable — if the user cancels the unsaved changes
dialog, watchers would remain closed for the rest of the session.
Move closeAllWatchers() to before-quit which only fires on actual quit.
---------
Co-authored-by: Chirag Chandrashekhar <cchirag85@gmail.com>