fix issue where shutting down the session immediately and asynchronously starting the DHT would cause a shutdown hang (#1203)

This commit is contained in:
Arvid Norberg 2016-10-10 22:54:19 -04:00 committed by GitHub
parent 6bb2d7c017
commit c966435d1c
2 changed files with 8 additions and 0 deletions

View File

@ -5805,6 +5805,8 @@ retry:
// postpone starting the DHT if we're still resolving the DHT router
if (m_outstanding_router_lookups > 0) return;
if (m_abort) return;
m_dht = boost::make_shared<dht::dht_tracker>(static_cast<dht_observer*>(this)
, boost::ref(m_udp_socket), boost::cref(m_dht_settings)
, boost::ref(m_stats_counters)

View File

@ -256,5 +256,11 @@ TORRENT_TEST(save_restore_state_load_filter)
});
}
TORRENT_TEST(session_shutdown)
{
lt::settings_pack pack;
lt::session ses(pack);
}
#endif