Skip to content
Snippets Groups Projects
Commit 709d51f4 authored by Olivier Dion's avatar Olivier Dion Committed by Sébastien Blin
Browse files

ice_transport: Replace assertion for conditional

Change-Id: Ieb12a81646de61bce2cbb1e369e1c8a82ea118da
parent caad9b34
Branches
No related tags found
No related merge requests found
...@@ -322,14 +322,15 @@ IceTransport::Impl::~Impl() ...@@ -322,14 +322,15 @@ IceTransport::Impl::~Impl()
thread_.join(); thread_.join();
} }
if (icest_) {
pj_ice_strans* strans = nullptr; pj_ice_strans* strans = nullptr;
std::swap(strans, icest_); std::swap(strans, icest_);
assert(strans);
// must be done before ioqueue/timer destruction // must be done before ioqueue/timer destruction
JAMI_INFO("[ice:%p] Destroying ice_strans %p", pj_ice_strans_get_user_data(strans), strans); JAMI_INFO("[ice:%p] Destroying ice_strans %p",
pj_ice_strans_get_user_data(strans), strans);
pj_ice_strans_stop_ice(strans); pj_ice_strans_stop_ice(strans);
pj_ice_strans_destroy(strans); pj_ice_strans_destroy(strans);
...@@ -345,7 +346,9 @@ IceTransport::Impl::~Impl() ...@@ -345,7 +346,9 @@ IceTransport::Impl::~Impl()
if (ret < 0) { if (ret < 0) {
JAMI_ERR("[ice:%p] IO queue polling failed", this); JAMI_ERR("[ice:%p] IO queue polling failed", this);
} else if (ret > 0) { } else if (ret > 0) {
JAMI_ERR("[ice:%p] Unexpected left timer in timer heap. Please report the bug", this); JAMI_ERR("[ice:%p] Unexpected left timer in timer heap. "
"Please report the bug",
this);
} }
if (checkEventQueue(1) > 0) { if (checkEventQueue(1) > 0) {
...@@ -357,6 +360,7 @@ IceTransport::Impl::~Impl() ...@@ -357,6 +360,7 @@ IceTransport::Impl::~Impl()
if (config_.stun_cfg.timer_heap) if (config_.stun_cfg.timer_heap)
pj_timer_heap_destroy(config_.stun_cfg.timer_heap); pj_timer_heap_destroy(config_.stun_cfg.timer_heap);
}
JAMI_DBG("[ice:%p] done destroying", this); JAMI_DBG("[ice:%p] done destroying", this);
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment