From 7edf3763a81d304df3d185084df726e6b0e1655d Mon Sep 17 00:00:00 2001 From: Jordan Rose Date: Tue, 30 Nov 2021 07:36:20 -0800 Subject: [PATCH] Hang up any active calls when quitting --- app/main.ts | 4 ++++ ts/services/calling.ts | 6 ++++++ 2 files changed, 10 insertions(+) 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(); }