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:
Arvid Norberg 2007-05-11 23:41:31 +00:00
parent bd3b191f83
commit 9ffde51404
2 changed files with 9 additions and 6 deletions

View File

@ -312,6 +312,14 @@ namespace libtorrent
io_service m_io_service;
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
// handing out bandwidth to connections that
// asks for it, it can also throttle the
@ -391,11 +399,6 @@ namespace libtorrent
// NAT or not.
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);
ptime m_last_tick;

View File

@ -477,6 +477,7 @@ namespace libtorrent { namespace detail
, fingerprint const& cl_fprint
, char const* listen_interface)
: m_strand(m_io_service)
, m_files(40)
, m_dl_bandwidth_manager(m_io_service, peer_connection::download_channel)
, m_ul_bandwidth_manager(m_io_service, peer_connection::upload_channel)
, m_tracker_manager(m_settings, m_tracker_proxy)
@ -488,7 +489,6 @@ namespace libtorrent { namespace detail
, m_max_uploads(-1)
, m_max_connections(-1)
, m_incoming_connection(false)
, m_files(40)
, m_last_tick(time_now())
#ifndef TORRENT_DISABLE_DHT
, m_dht_same_port(true)