Fix call crash

This commit is contained in:
Julien Wadel 2023-01-13 16:50:18 +01:00
parent 165ef1a46a
commit e2cac1a4ac
2 changed files with 7 additions and 5 deletions

View file

@ -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;

View file

@ -94,7 +94,7 @@ private:
void deactivatePreview();
void updateWindowIdLocation();
void removeParticipantDeviceModel();
void callRemoved();
void removeCallModel();
QVariantMap mLastVideoDefinition;
QTimer mLastVideoDefinitionChecker;