From a4602236df49084c23ca98ae505728415c697102 Mon Sep 17 00:00:00 2001 From: Gaelle Braud Date: Thu, 19 Feb 2026 10:40:08 +0100 Subject: [PATCH] fix macos crash on close due to mainwindow being destroyed --- Linphone/core/App.cpp | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/Linphone/core/App.cpp b/Linphone/core/App.cpp index 46f768841..1a11ef697 100644 --- a/Linphone/core/App.cpp +++ b/Linphone/core/App.cpp @@ -1218,7 +1218,7 @@ bool App::notify(QObject *receiver, QEvent *event) { } void App::handleAccountActivity(QSharedPointer accountCore) { - if (!accountCore) return; + if (!accountCore || !mMainWindow) return; auto accountPresence = accountCore->getPresence(); if ((mMainWindow && mMainWindow->isActive() || (mCallsWindow && mCallsWindow->isActive())) && accountPresence == LinphoneEnums::Presence::Away) { @@ -1567,13 +1567,9 @@ bool App::event(QEvent *event) { receivedMessage(0, url.toLocal8Bit()); } else if (event->type() == QEvent::ApplicationStateChange) { auto state = static_cast(event); - if (state->applicationState() == Qt::ApplicationActive) Utils::smartShowWindow(getLastActiveWindow()); - } else if (event->type() == QEvent::ApplicationActivate) { - for (int i = 0; i < getAccountList()->rowCount(); ++i) { - auto accountCore = getAccountList()->getAt(i); - handleAccountActivity(accountCore); + if (state->applicationState() == Qt::ApplicationActive) { + Utils::smartShowWindow(getLastActiveWindow()); } - } else if (event->type() == QEvent::ApplicationDeactivate) { for (int i = 0; i < getAccountList()->rowCount(); ++i) { auto accountCore = getAccountList()->getAt(i); handleAccountActivity(accountCore);