diff --git a/ChangeLog b/ChangeLog index ddee6ae8d..82afb120a 100644 --- a/ChangeLog +++ b/ChangeLog @@ -56,6 +56,7 @@ release 0.14.3 or checking, to maintain stats and renamed files * Don't try IPv6 on windows if it's not installed * move_storage fix + * fixed potential crash on shutdown release 0.14.2 diff --git a/include/libtorrent/peer_connection.hpp b/include/libtorrent/peer_connection.hpp index 7f3e72fa6..a64cc0ef5 100644 --- a/include/libtorrent/peer_connection.hpp +++ b/include/libtorrent/peer_connection.hpp @@ -621,6 +621,10 @@ namespace libtorrent void on_disk_write_complete(int ret, disk_io_job const& j , peer_request r, boost::shared_ptr t); + // keep the io_service running as long as we + // have peer connections + io_service::work m_work; + // the time when we last got a part of a // piece packet from this peer ptime m_last_piece; diff --git a/src/peer_connection.cpp b/src/peer_connection.cpp index cd384c222..071487842 100644 --- a/src/peer_connection.cpp +++ b/src/peer_connection.cpp @@ -76,6 +76,7 @@ namespace libtorrent #endif m_ses(ses) , m_max_out_request_queue(m_ses.settings().max_out_request_queue) + , m_work(ses.m_io_service) , m_last_piece(time_now()) , m_last_request(time_now()) , m_last_incoming_request(min_time()) @@ -193,6 +194,7 @@ namespace libtorrent #endif m_ses(ses) , m_max_out_request_queue(m_ses.settings().max_out_request_queue) + , m_work(ses.m_io_service) , m_last_piece(time_now()) , m_last_request(time_now()) , m_last_incoming_request(min_time())