Make process.exit() quit gracefully
Instead of abrupting the whole program immediately, we should close all windows and release all native resources gracefully on exit. This avoids possible crashes. Fix #3350.
This commit is contained in:
parent
c10c74b23a
commit
863199348f
8 changed files with 59 additions and 1 deletions
|
@ -208,6 +208,15 @@ This method guarantees that all `beforeunload` and `unload` event handlers are
|
|||
correctly executed. It is possible that a window cancels the quitting by
|
||||
returning `false` in the `beforeunload` event handler.
|
||||
|
||||
### `app.exit(exitCode)`
|
||||
|
||||
* `exitCode` Integer
|
||||
|
||||
Exits immediately with `exitCode`.
|
||||
|
||||
All windows will be closed immediately without asking user and the `before-quit`
|
||||
and `will-quit` events will not be emitted.
|
||||
|
||||
### `app.getAppPath()`
|
||||
|
||||
Returns the current application directory.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue