From e2cac1a4acaf5e43b209e9536930a21cc61c4ffe Mon Sep 17 00:00:00 2001 From: Julien Wadel Date: Fri, 13 Jan 2023 16:50:18 +0100 Subject: [PATCH] Fix call crash --- linphone-app/src/components/camera/Camera.cpp | 10 ++++++---- linphone-app/src/components/camera/Camera.hpp | 2 +- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/linphone-app/src/components/camera/Camera.cpp b/linphone-app/src/components/camera/Camera.cpp index 55f002dbd..e4f15b93d 100644 --- a/linphone-app/src/components/camera/Camera.cpp +++ b/linphone-app/src/components/camera/Camera.cpp @@ -159,7 +159,7 @@ void Camera::removeParticipantDeviceModel(){ mParticipantDeviceModel = nullptr; } -void Camera::callRemoved(){ +void Camera::removeCallModel(){ mCallModel = nullptr; } @@ -229,11 +229,13 @@ ParticipantDeviceModel * Camera::getParticipantDeviceModel() const{ void Camera::setCallModel (CallModel *callModel) { if (mCallModel != callModel) { - if( mCallModel) + if( mCallModel){ disconnect(mCallModel, &CallModel::statusChanged, this, &Camera::onCallStateChanged); + disconnect(mCallModel, &QObject::destroyed, this, &Camera::removeCallModel); + } mCallModel = callModel; connect(mCallModel, &CallModel::statusChanged, this, &Camera::onCallStateChanged); - connect(mCallModel, &QObject::destroyed, this, &Camera::callRemoved); + connect(mCallModel, &QObject::destroyed, this, &Camera::removeCallModel); updateWindowIdLocation(); update(); @@ -263,7 +265,7 @@ void Camera::setIsReady(bool status) { } void Camera::setParticipantDeviceModel(ParticipantDeviceModel * participantDeviceModel){ -if (mParticipantDeviceModel != participantDeviceModel) { + if (mParticipantDeviceModel != participantDeviceModel) { if( mParticipantDeviceModel) disconnect(mParticipantDeviceModel, &QObject::destroyed, this, &Camera::removeParticipantDeviceModel); mParticipantDeviceModel = participantDeviceModel; diff --git a/linphone-app/src/components/camera/Camera.hpp b/linphone-app/src/components/camera/Camera.hpp index 093d1ac79..afb78e4d7 100644 --- a/linphone-app/src/components/camera/Camera.hpp +++ b/linphone-app/src/components/camera/Camera.hpp @@ -94,7 +94,7 @@ private: void deactivatePreview(); void updateWindowIdLocation(); void removeParticipantDeviceModel(); - void callRemoved(); + void removeCallModel(); QVariantMap mLastVideoDefinition; QTimer mLastVideoDefinitionChecker;