added option to delete files from disk as a torrent is removed

This commit is contained in:
Arvid Norberg
2007-10-13 03:33:33 +00:00
parent 09bcb3ff2e
commit 59c7f5bfbb
12 changed files with 139 additions and 14 deletions

View File

@@ -125,6 +125,7 @@ namespace libtorrent
, boost::function<void(int, disk_io_job const&)> const& f)
{
TORRENT_ASSERT(!j.callback);
TORRENT_ASSERT(j.storage);
boost::mutex::scoped_lock l(m_mutex);
std::deque<disk_io_job>::reverse_iterator i = m_jobs.rbegin();
@@ -220,6 +221,7 @@ namespace libtorrent
bool free_buffer = true;
try
{
TORRENT_ASSERT(j.storage);
#ifdef TORRENT_DISK_STATS
ptime start = time_now();
#endif
@@ -288,6 +290,12 @@ namespace libtorrent
#endif
j.storage->release_files_impl();
break;
case disk_io_job::delete_files:
#ifdef TORRENT_DISK_STATS
m_log << log_time() << " delete" << std::endl;
#endif
j.storage->delete_files_impl();
break;
}
}
catch (std::exception& e)