From 6fb43fe3f3d1e2c6807166f14cf23dbd36f1e7b5 Mon Sep 17 00:00:00 2001 From: Arvid Norberg Date: Thu, 30 Jun 2005 12:59:23 +0000 Subject: [PATCH] storage fix --- src/storage.cpp | 25 +++++++++++++++++++++---- 1 file changed, 21 insertions(+), 4 deletions(-) diff --git a/src/storage.cpp b/src/storage.cpp index 252419ad5..041cbfb22 100755 --- a/src/storage.cpp +++ b/src/storage.cpp @@ -189,7 +189,21 @@ namespace upper_key.info_hash[19] += 1; std::pair r = pt.range(!(_1 < lower_key), _1 < upper_key); +/* + std::cerr << "releasing files!\n"; + for (path_view::iterator i = r.first; i != r.second; ++i) + { + std::cerr << i->key.file_path.native_file_string() << "\n"; + } +*/ pt.erase(r.first, r.second); +/* + std::cerr << "files left: " << pt.size() << "\n"; + for (path_view::iterator i = pt.begin(); i != pt.end(); ++i) + { + std::cerr << i->key.file_path.native_file_string() << "\n"; + } +*/ } private: @@ -211,14 +225,12 @@ namespace libtorrent { std::vector > get_filesizes( - const torrent_info& t - , path p) + const torrent_info& t, path p) { p = complete(p); std::vector > sizes; for (torrent_info::file_iterator i = t.begin_files(); - i != t.end_files(); - ++i) + i != t.end_files(); ++i) { size_type size = 0; std::time_t time = 0; @@ -333,6 +345,11 @@ namespace libtorrent , save_path(x.save_path) {} + ~impl() + { + files.release(info.info_hash()); + } + torrent_info const& info; path save_path; static file_pool files;