mirror of
https://github.com/ElectronNET/Electron.NET.git
synced 2026-09-21 22:45:20 +00:00
force-destroy all windows on before-quit-for-update
This commit is contained in:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user