diff --git a/src/manager.cpp b/src/manager.cpp index 00cd613b46d01455d2ada553b31bd80409458902..92bc03187c8ad4df342736edecf0d3be3fa72bf8 100644 --- a/src/manager.cpp +++ b/src/manager.cpp @@ -838,13 +838,17 @@ Manager::finish() noexcept pimpl_->audiodriver_.reset(); } - pimpl_->ice_tf_.reset(); // Flush remaining tasks (free lambda' with capture) pimpl_->scheduler_.stop(); dht::ThreadPool::io().join(); dht::ThreadPool::computation().join(); + // IceTransportFactory should be stopped after the io pool + // as some ICE are destroyed in a ioPool (see ConnectionManager) + // Also, it must be called before pj_shutdown to avoid any problem + pimpl_->ice_tf_.reset(); + pj_shutdown(); if (!pimpl_->ioContext_->stopped()){