Skip to content
Snippets Groups Projects
Commit 797131da authored by Adrien Béraud's avatar Adrien Béraud
Browse files

sipcall: cleanup

Change-Id: I993003f8d448a1181ecdd167df10bedc2048b76e
parent c38ba2ed
Branches
Tags
No related merge requests found
...@@ -167,11 +167,10 @@ SIPCall::setTransport(const std::shared_ptr<SipTransport>& t) ...@@ -167,11 +167,10 @@ SIPCall::setTransport(const std::shared_ptr<SipTransport>& t)
if (transport_) { if (transport_) {
setSecure(transport_->isSecure()); setSecure(transport_->isSecure());
std::weak_ptr<SIPCall> wthis_ = std::static_pointer_cast<SIPCall>(shared_from_this());
// listen for transport destruction // listen for transport destruction
transport_->addStateListener(list_id, transport_->addStateListener(list_id,
[wthis_] (pjsip_transport_state state, const pjsip_transport_state_info*) { [wthis_ = weak()] (pjsip_transport_state state, const pjsip_transport_state_info*) {
if (auto this_ = wthis_.lock()) { if (auto this_ = wthis_.lock()) {
// end the call if the SIP transport is shut down // end the call if the SIP transport is shut down
if (not SipTransport::isAlive(this_->transport_, state) and this_->getConnectionState() != ConnectionState::DISCONNECTED) { if (not SipTransport::isAlive(this_->transport_, state) and this_->getConnectionState() != ConnectionState::DISCONNECTED) {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment