fix crash (ParticipantDeviceCore with nullptr model can be created if active speaker becomes null)

This commit is contained in:
gaelle 2025-03-11 10:52:47 +01:00 committed by Gaëlle Braud
parent 8f6a448b1d
commit 327f5e9123
2 changed files with 2 additions and 2 deletions

View file

@ -68,7 +68,7 @@ ParticipantDeviceCore::ParticipantDeviceCore(const std::shared_ptr<linphone::Par
} }
ParticipantDeviceCore::~ParticipantDeviceCore() { ParticipantDeviceCore::~ParticipantDeviceCore() {
mParticipantDeviceModel->removeListener(); if (mParticipantDeviceModel) mParticipantDeviceModel->removeListener();
} }
void ParticipantDeviceCore::setSelf(QSharedPointer<ParticipantDeviceCore> me) { void ParticipantDeviceCore::setSelf(QSharedPointer<ParticipantDeviceCore> me) {

View file

@ -171,7 +171,7 @@ bool ConferenceModel::isScreenSharingEnabled() const {
void ConferenceModel::onActiveSpeakerParticipantDevice( void ConferenceModel::onActiveSpeakerParticipantDevice(
const std::shared_ptr<linphone::Conference> &conference, const std::shared_ptr<linphone::Conference> &conference,
const std::shared_ptr<const linphone::ParticipantDevice> &participantDevice) { const std::shared_ptr<const linphone::ParticipantDevice> &participantDevice) {
lDebug() << "onActiveSpeakerParticipantDevice: " << participantDevice->getAddress()->asString().c_str(); lDebug() << "onActiveSpeakerParticipantDevice: " << (participantDevice ? participantDevice->getAddress()->asString().c_str() : "NULL");
emit activeSpeakerParticipantDevice(conference, conference->getActiveSpeakerParticipantDevice()); emit activeSpeakerParticipantDevice(conference, conference->getActiveSpeakerParticipantDevice());
} }