Commit 6a47380f authored by Ronan Abhamon's avatar Ronan Abhamon

fix(src/components/notifier/Notifier): destroy call notification when call is terminated

parent 2ef80f31
......@@ -163,9 +163,10 @@ void Notifier::showNotification (QObject *notification, int timeout) {
void Notifier::deleteNotification (QVariant notification) {
QObject *instance = notification.value<QObject *>();
instance->property(NOTIFICATION_PROPERTY_TIMER).value<QTimer *>()->stop();
qDebug() << "Delete notification.";
m_mutex.lock();
m_n_instances--;
......@@ -215,9 +216,9 @@ void Notifier::notifyReceivedCall (const shared_ptr<linphone::Call> &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<QQuickWindow *>()->setVisible(false);
deleteNotification(QVariant::fromValue(notification));
}
);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment