fixed crash when shutting down while checking a torrent
This commit is contained in:
@@ -61,6 +61,7 @@ release 0.14.3
|
|||||||
* fixed bug where connection would hang when receiving a keepalive
|
* fixed bug where connection would hang when receiving a keepalive
|
||||||
* fixed bug where an asio exception could be thrown when resolving
|
* fixed bug where an asio exception could be thrown when resolving
|
||||||
peer countries
|
peer countries
|
||||||
|
* fixed crash when shutting down while checking a torrent
|
||||||
|
|
||||||
release 0.14.2
|
release 0.14.2
|
||||||
|
|
||||||
|
@@ -2464,6 +2464,17 @@ namespace aux {
|
|||||||
abort();
|
abort();
|
||||||
TORRENT_ASSERT(m_connections.empty());
|
TORRENT_ASSERT(m_connections.empty());
|
||||||
|
|
||||||
|
// we need to wait for the disk-io thread to
|
||||||
|
// die first, to make sure it won't post any
|
||||||
|
// more messages to the io_service containing references
|
||||||
|
// to disk_io_pool inside the disk_io_thread. Once
|
||||||
|
// the main thread has handled all the outstanding requests
|
||||||
|
// we know it's safe to destruct the disk thread.
|
||||||
|
#if defined(TORRENT_VERBOSE_LOGGING) || defined(TORRENT_LOGGING)
|
||||||
|
(*m_logger) << time_now_string() << " waiting for disk io thread\n";
|
||||||
|
#endif
|
||||||
|
m_disk_thread.join();
|
||||||
|
|
||||||
#ifndef TORRENT_DISABLE_GEO_IP
|
#ifndef TORRENT_DISABLE_GEO_IP
|
||||||
if (m_asnum_db) GeoIP_delete(m_asnum_db);
|
if (m_asnum_db) GeoIP_delete(m_asnum_db);
|
||||||
if (m_country_db) GeoIP_delete(m_country_db);
|
if (m_country_db) GeoIP_delete(m_country_db);
|
||||||
@@ -2474,13 +2485,6 @@ namespace aux {
|
|||||||
m_thread->join();
|
m_thread->join();
|
||||||
|
|
||||||
TORRENT_ASSERT(m_torrents.empty());
|
TORRENT_ASSERT(m_torrents.empty());
|
||||||
|
|
||||||
#if defined(TORRENT_VERBOSE_LOGGING) || defined(TORRENT_LOGGING)
|
|
||||||
(*m_logger) << time_now_string() << " waiting for disk io thread\n";
|
|
||||||
#endif
|
|
||||||
m_disk_thread.join();
|
|
||||||
|
|
||||||
TORRENT_ASSERT(m_torrents.empty());
|
|
||||||
TORRENT_ASSERT(m_connections.empty());
|
TORRENT_ASSERT(m_connections.empty());
|
||||||
#if defined(TORRENT_VERBOSE_LOGGING) || defined(TORRENT_LOGGING)
|
#if defined(TORRENT_VERBOSE_LOGGING) || defined(TORRENT_LOGGING)
|
||||||
(*m_logger) << time_now_string() << " shutdown complete!\n";
|
(*m_logger) << time_now_string() << " shutdown complete!\n";
|
||||||
|
Reference in New Issue
Block a user