force-destroy all windows on before-quit-for-update

This commit is contained in:
theolivenbaum
2021-09-08 08:47:16 +02:00
parent 9be80abfcf
commit 5559fc61b1

View File

@@ -51,6 +51,20 @@ app.on('will-finish-launching', () => {
app.on('before-quit-for-update', () => {
ignoreApiProcessClosed = true;
const windows = BrowserWindow.getAllWindows();
if (windows.length) {
windows.forEach(w => {
try {
w.hide();
w.destroy();
}
catch {
//ignore, probably already destroyed
}
});
}
});
const manifestJsonFile = require(manifestJsonFilePath);