forked from premiere/premiere-libtorrent
fixed a bug caused by file_pool being destructed before torrents, and torrents using the file pool in their destructors
This commit is contained in:
parent
bd3b191f83
commit
9ffde51404
|
@ -312,6 +312,14 @@ namespace libtorrent
|
||||||
io_service m_io_service;
|
io_service m_io_service;
|
||||||
asio::strand m_strand;
|
asio::strand m_strand;
|
||||||
|
|
||||||
|
// the file pool that all storages in this session's
|
||||||
|
// torrents uses. It sets a limit on the number of
|
||||||
|
// open files by this session.
|
||||||
|
// file pool must be destructed after the torrents
|
||||||
|
// since they will still have references to it
|
||||||
|
// when they are destructed.
|
||||||
|
file_pool m_files;
|
||||||
|
|
||||||
// the bandwidth manager is responsible for
|
// the bandwidth manager is responsible for
|
||||||
// handing out bandwidth to connections that
|
// handing out bandwidth to connections that
|
||||||
// asks for it, it can also throttle the
|
// asks for it, it can also throttle the
|
||||||
|
@ -391,11 +399,6 @@ namespace libtorrent
|
||||||
// NAT or not.
|
// NAT or not.
|
||||||
bool m_incoming_connection;
|
bool m_incoming_connection;
|
||||||
|
|
||||||
// the file pool that all storages in this session's
|
|
||||||
// torrents uses. It sets a limit on the number of
|
|
||||||
// open files by this session.
|
|
||||||
file_pool m_files;
|
|
||||||
|
|
||||||
void second_tick(asio::error_code const& e);
|
void second_tick(asio::error_code const& e);
|
||||||
ptime m_last_tick;
|
ptime m_last_tick;
|
||||||
|
|
||||||
|
|
|
@ -477,6 +477,7 @@ namespace libtorrent { namespace detail
|
||||||
, fingerprint const& cl_fprint
|
, fingerprint const& cl_fprint
|
||||||
, char const* listen_interface)
|
, char const* listen_interface)
|
||||||
: m_strand(m_io_service)
|
: m_strand(m_io_service)
|
||||||
|
, m_files(40)
|
||||||
, m_dl_bandwidth_manager(m_io_service, peer_connection::download_channel)
|
, m_dl_bandwidth_manager(m_io_service, peer_connection::download_channel)
|
||||||
, m_ul_bandwidth_manager(m_io_service, peer_connection::upload_channel)
|
, m_ul_bandwidth_manager(m_io_service, peer_connection::upload_channel)
|
||||||
, m_tracker_manager(m_settings, m_tracker_proxy)
|
, m_tracker_manager(m_settings, m_tracker_proxy)
|
||||||
|
@ -488,7 +489,6 @@ namespace libtorrent { namespace detail
|
||||||
, m_max_uploads(-1)
|
, m_max_uploads(-1)
|
||||||
, m_max_connections(-1)
|
, m_max_connections(-1)
|
||||||
, m_incoming_connection(false)
|
, m_incoming_connection(false)
|
||||||
, m_files(40)
|
|
||||||
, m_last_tick(time_now())
|
, m_last_tick(time_now())
|
||||||
#ifndef TORRENT_DISABLE_DHT
|
#ifndef TORRENT_DISABLE_DHT
|
||||||
, m_dht_same_port(true)
|
, m_dht_same_port(true)
|
||||||
|
|
Loading…
Reference in New Issue