diff --git a/app/main.ts b/app/main.ts index ef91f41218..7e0ecb6bcc 100644 --- a/app/main.ts +++ b/app/main.ts @@ -1700,6 +1700,10 @@ app.on('before-quit', () => { }); windowState.markShouldQuit(); + + if (mainWindow) { + mainWindow.webContents.send('quit'); + } }); // Quit when all windows are closed. diff --git a/ts/services/calling.ts b/ts/services/calling.ts index a6c7187223..181d6e110d 100644 --- a/ts/services/calling.ts +++ b/ts/services/calling.ts @@ -288,6 +288,12 @@ export class CallingClass { uxActions.setPresenting(); }); + ipcRenderer.on('quit', () => { + for (const conversationId of Object.keys(this.callsByConversation)) { + this.hangup(conversationId); + } + }); + this.cleanExpiredGroupCallRingsAndLoop(); }