fixed memory leak in disk io thread when not using the cache

This commit is contained in:
Arvid Norberg 2009-06-14 22:48:07 +00:00
parent 62a7946968
commit 3df15ad39e
3 changed files with 8 additions and 1 deletions

View File

@ -61,6 +61,7 @@ release 0.14.5
* fixed bug when handling malformed webseed urls and an http proxy
* fixed bug when setting unlimited upload or download rates for torrents
* fix to make torrent_status::list_peers more accurate.
* fixed memory leak in disk io thread when not using the cache
release 0.14.4

View File

@ -1608,6 +1608,7 @@ namespace libtorrent
test_error(j);
break;
}
break;
}
}
// we've now inserted the buffer

View File

@ -88,6 +88,8 @@ void test_transfer(boost::intrusive_ptr<torrent_info> torrent_file, int proxy)
float rate_sum = 0.f;
float ses_rate_sum = 0.f;
cache_status cs;
for (int i = 0; i < 30; ++i)
{
torrent_status s = th.status();
@ -95,7 +97,7 @@ void test_transfer(boost::intrusive_ptr<torrent_info> torrent_file, int proxy)
rate_sum += s.download_payload_rate;
ses_rate_sum += ss.payload_download_rate;
cache_status cs = ses.get_cache_status();
cs = ses.get_cache_status();
if (cs.blocks_read < 1) cs.blocks_read = 1;
if (cs.blocks_written < 1) cs.blocks_written = 1;
@ -121,6 +123,9 @@ void test_transfer(boost::intrusive_ptr<torrent_info> torrent_file, int proxy)
test_sleep(1000);
}
TEST_CHECK(cs.cache_size == 0);
TEST_CHECK(cs.total_used_buffers == 0);
std::cerr << "total_size: " << total_size
<< " rate_sum: " << rate_sum
<< " session_rate_sum: " << ses_rate_sum