From 6a47380fc4521731f6ddbf7f26b3eeb3638ec119 Mon Sep 17 00:00:00 2001 From: Ronan Abhamon Date: Tue, 28 Feb 2017 10:26:20 +0100 Subject: [PATCH] fix(src/components/notifier/Notifier): destroy call notification when call is terminated --- linphone-desktop/src/components/notifier/Notifier.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) 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)); } );