diff --git a/src/session_impl.cpp b/src/session_impl.cpp index dc1474f67..d24af11e8 100644 --- a/src/session_impl.cpp +++ b/src/session_impl.cpp @@ -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(static_cast(this) , boost::ref(m_udp_socket), boost::cref(m_dht_settings) , boost::ref(m_stats_counters) diff --git a/test/test_session.cpp b/test/test_session.cpp index fec541ad0..573eea1e4 100644 --- a/test/test_session.cpp +++ b/test/test_session.cpp @@ -256,5 +256,11 @@ TORRENT_TEST(save_restore_state_load_filter) }); } +TORRENT_TEST(session_shutdown) +{ + lt::settings_pack pack; + lt::session ses(pack); +} + #endif