diff --git a/linphone-desktop/src/components/notifier/Notifier.cpp b/linphone-desktop/src/components/notifier/Notifier.cpp index c8bac5a3a..a9dc2fd7e 100644 --- a/linphone-desktop/src/components/notifier/Notifier.cpp +++ b/linphone-desktop/src/components/notifier/Notifier.cpp @@ -163,9 +163,10 @@ void Notifier::showNotification (QObject *notification, int timeout) { void Notifier::deleteNotification (QVariant notification) { QObject *instance = notification.value(); - instance->property(NOTIFICATION_PROPERTY_TIMER).value()->stop(); + qDebug() << "Delete notification."; + m_mutex.lock(); m_n_instances--; @@ -215,9 +216,9 @@ void Notifier::notifyReceivedCall (const shared_ptr &call) { CallModel *model = CoreManager::getInstance()->getCallsListModel()->getCall(call); QObject::connect( - model, &CallModel::statusChanged, notification, [notification](CallModel::CallStatus status) { + model, &CallModel::statusChanged, notification, [this, notification](CallModel::CallStatus status) { if (status == CallModel::CallStatusEnded) - notification->findChild()->setVisible(false); + deleteNotification(QVariant::fromValue(notification)); } );