Skip to content
Snippets Groups Projects
Commit 57a58807 authored by Sébastien Blin's avatar Sébastien Blin Committed by Adrien Béraud
Browse files

sipsicetransport: avoid to call shutdown callback without object

Change-Id: I6f92c33c8b0087b58e7d692bde4d3421906fb61a
parent cea2ad8d
Branches
No related tags found
No related merge requests found
......@@ -249,10 +249,11 @@ SipsIceTransport::SipsIceTransport(pjsip_endpoint* endpt,
}};
tls_ = std::make_unique<TlsSession>(std::move(iceSocket), param, cbs);
ice_->setOnShutdown([this]() {
if (tls_)
tls_->shutdown();
});
if (ice_)
ice_->setOnShutdown([this]() {
if (tls_)
tls_->shutdown();
});
if (pjsip_transport_register(base.tpmgr, &base) != PJ_SUCCESS)
throw std::runtime_error("Can't register PJSIP transport.");
......@@ -260,6 +261,8 @@ SipsIceTransport::SipsIceTransport(pjsip_endpoint* endpt,
SipsIceTransport::~SipsIceTransport()
{
if (ice_)
ice_->setOnShutdown({});
JAMI_DBG("~SipIceTransport@%p {tr=%p}", this, &trData_.base);
stopLoop_ = true;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment