mirror of
https://gitlab.linphone.org/BC/public/linphone-desktop.git
synced 2026-04-17 20:08:28 +00:00
fix macos crash on close due to mainwindow being destroyed
This commit is contained in:
parent
9952791f22
commit
a4602236df
1 changed files with 3 additions and 7 deletions
|
|
@ -1218,7 +1218,7 @@ bool App::notify(QObject *receiver, QEvent *event) {
|
|||
}
|
||||
|
||||
void App::handleAccountActivity(QSharedPointer<AccountCore> 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<QApplicationStateChangeEvent *>(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<AccountCore>(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<AccountCore>(i);
|
||||
handleAccountActivity(accountCore);
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue