Commit 6df705df authored by Andrea Gianarda's avatar Andrea Gianarda
Browse files

Set ptr to conference to NULL when removing participant

parent 8ee86eea
...@@ -643,6 +643,11 @@ int LocalConference::removeParticipant (const std::shared_ptr<LinphonePrivate::C ...@@ -643,6 +643,11 @@ int LocalConference::removeParticipant (const std::shared_ptr<LinphonePrivate::C
// This is the default behaviour // This is the default behaviour
err = static_pointer_cast<LinphonePrivate::MediaSession>(session)->terminate(); err = static_pointer_cast<LinphonePrivate::MediaSession>(session)->terminate();
} }
if (call) {
call->setConference(nullptr);
}
} }
} }
...@@ -695,6 +700,13 @@ int LocalConference::removeParticipant (const std::shared_ptr<LinphonePrivate::C ...@@ -695,6 +700,13 @@ int LocalConference::removeParticipant (const std::shared_ptr<LinphonePrivate::C
/* invoke removeParticipant() recursively to remove this last participant. */ /* invoke removeParticipant() recursively to remove this last participant. */
bool success = Conference::removeParticipant(remaining_participant); bool success = Conference::removeParticipant(remaining_participant);
mMixerSession->unjoinStreamsGroup(session->getStreamsGroup()); mMixerSession->unjoinStreamsGroup(session->getStreamsGroup());
// Detach call from conference
shared_ptr<Call> lastSessionCall = getCore()->getCallByRemoteAddress (*session->getRemoteAddress());
if (lastSessionCall) {
lastSessionCall->setConference(nullptr);
}
return success; return success;
} }
} }
......
...@@ -354,7 +354,7 @@ void Call::exitFromConference (const shared_ptr<CallSession> &session) { ...@@ -354,7 +354,7 @@ void Call::exitFromConference (const shared_ptr<CallSession> &session) {
// Remove participant from local conference // Remove participant from local conference
if (getConference()) { if (getConference()) {
lInfo() << "Removing terminated call (local addres " << getLocalAddress().asString() << " remote address " << getRemoteAddress()->asString() << ") from LinphoneConference " << getConference(); lInfo() << "Removing terminated call (local addres " << getLocalAddress().asString() << " remote address " << getRemoteAddress()->asString() << ") from LinphoneConference " << getConference();
MediaConference::Conference::toCpp(getConference())->removeParticipant(getSharedFromThis()); MediaConference::Conference::toCpp(getConference())->removeParticipant(getSharedFromThis());
} }
} else { } else {
// Searching remote conference to terminate it // Searching remote conference to terminate it
......
...@@ -1017,6 +1017,19 @@ static LinphoneStatus check_participant_removal(bctbx_list_t * lcs, LinphoneCore ...@@ -1017,6 +1017,19 @@ static LinphoneStatus check_participant_removal(bctbx_list_t * lcs, LinphoneCore
BC_ASSERT_TRUE(wait_for_list(lcs,&conf_mgr->stat.number_of_LinphoneConferenceStateTerminated,(conf_initial_stats.number_of_LinphoneConferenceStateTerminated + 1),10000)); BC_ASSERT_TRUE(wait_for_list(lcs,&conf_mgr->stat.number_of_LinphoneConferenceStateTerminated,(conf_initial_stats.number_of_LinphoneConferenceStateTerminated + 1),10000));
BC_ASSERT_TRUE(wait_for_list(lcs,&conf_mgr->stat.number_of_LinphoneConferenceStateDeleted,(conf_initial_stats.number_of_LinphoneConferenceStateDeleted + 1),10000)); BC_ASSERT_TRUE(wait_for_list(lcs,&conf_mgr->stat.number_of_LinphoneConferenceStateDeleted,(conf_initial_stats.number_of_LinphoneConferenceStateDeleted + 1),10000));
if (conf_call) {
BC_ASSERT_PTR_NULL(linphone_call_get_conference(conf_call));
BC_ASSERT_FALSE(linphone_call_is_in_conference(conf_call));
}
LinphoneCall * participant_call = linphone_core_get_call_by_remote_address2(m->lc, conf_mgr->identity);
BC_ASSERT_PTR_NOT_NULL(participant_call);
if (participant_call) {
BC_ASSERT_PTR_NULL(linphone_call_get_conference(participant_call));
BC_ASSERT_FALSE(linphone_call_is_in_conference(participant_call));
}
bool_t conf_event_log_enabled = linphone_config_get_bool(linphone_core_get_config(conf_mgr->lc), "misc", "conference_event_log_enabled", TRUE ); bool_t conf_event_log_enabled = linphone_config_get_bool(linphone_core_get_config(conf_mgr->lc), "misc", "conference_event_log_enabled", TRUE );
if (conf_event_log_enabled) { if (conf_event_log_enabled) {
BC_ASSERT_TRUE(wait_for_list(lcs,&conf_mgr->stat.number_of_LinphoneSubscriptionTerminated,conf_initial_stats.number_of_LinphoneSubscriptionTerminated + 2,10000)); BC_ASSERT_TRUE(wait_for_list(lcs,&conf_mgr->stat.number_of_LinphoneSubscriptionTerminated,conf_initial_stats.number_of_LinphoneSubscriptionTerminated + 2,10000));
......
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