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
// This is the default behaviour
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
/* invoke removeParticipant() recursively to remove this last participant. */
bool success = Conference::removeParticipant(remaining_participant);
mMixerSession->unjoinStreamsGroup(session->getStreamsGroup());
// Detach call from conference
shared_ptr<Call> lastSessionCall = getCore()->getCallByRemoteAddress (*session->getRemoteAddress());
if (lastSessionCall) {
lastSessionCall->setConference(nullptr);
}
return success;
}
}
......
......@@ -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_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 );
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));
......
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