Skip to content

Commit ce86430

Browse files
authored
fix(app-shell-odd): quit the app when the render process is killed. (#15500)
1 parent abf7f02 commit ce86430

File tree

1 file changed

+12
-2
lines changed

1 file changed

+12
-2
lines changed

app-shell-odd/src/main.ts

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -61,8 +61,8 @@ let rendererLogger: Logger
6161
app.prependOnceListener('ready', startUp)
6262
if (config.devtools) app.once('ready', installDevtools)
6363

64-
app.once('window-all-closed', () => {
65-
log.debug('all windows closed, quitting the app')
64+
function quitApplication(): void {
65+
app.quit()
6666
closeBrokerConnection()
6767
.then(() => {
6868
app.quit()
@@ -71,6 +71,16 @@ app.once('window-all-closed', () => {
7171
log.warn('Failed to properly close MQTT connections:', error)
7272
app.quit()
7373
})
74+
}
75+
76+
app.once('window-all-closed', () => {
77+
log.debug('all windows closed, quitting the app')
78+
quitApplication()
79+
})
80+
81+
app.once('render-process-gone', (_, __, details) => {
82+
log.error('Renderer process has died, quitting the app', details)
83+
quitApplication()
7484
})
7585

7686
function startUp(): void {

0 commit comments

Comments
 (0)