mytec: after methods
This commit is contained in:
@@ -279,11 +279,21 @@ function createMainWindow() {
|
||||
if (!isQuitting) {
|
||||
event.preventDefault();
|
||||
isQuitting = true;
|
||||
gracefulShutdown().then(() => {
|
||||
app.quit();
|
||||
}).catch(() => {
|
||||
|
||||
// Hard timeout: force exit after 5 seconds no matter what
|
||||
const forceExitTimer = setTimeout(() => {
|
||||
log('[CLOSE] Force exit after 5s timeout');
|
||||
killAllRfcpProcesses();
|
||||
app.quit();
|
||||
process.exit(0);
|
||||
}, 5000);
|
||||
|
||||
gracefulShutdown().then(() => {
|
||||
clearTimeout(forceExitTimer);
|
||||
app.exit(0);
|
||||
}).catch(() => {
|
||||
clearTimeout(forceExitTimer);
|
||||
killAllRfcpProcesses();
|
||||
app.exit(0);
|
||||
});
|
||||
}
|
||||
});
|
||||
@@ -534,11 +544,20 @@ app.on('before-quit', (event) => {
|
||||
if (!isQuitting) {
|
||||
event.preventDefault();
|
||||
isQuitting = true;
|
||||
gracefulShutdown().then(() => {
|
||||
app.quit();
|
||||
}).catch(() => {
|
||||
|
||||
const forceExitTimer = setTimeout(() => {
|
||||
log('[CLOSE] Force exit from before-quit after 5s');
|
||||
killAllRfcpProcesses();
|
||||
app.quit();
|
||||
process.exit(0);
|
||||
}, 5000);
|
||||
|
||||
gracefulShutdown().then(() => {
|
||||
clearTimeout(forceExitTimer);
|
||||
app.exit(0);
|
||||
}).catch(() => {
|
||||
clearTimeout(forceExitTimer);
|
||||
killAllRfcpProcesses();
|
||||
app.exit(0);
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user