From 2b6fdc17284aa2db1fc2bc9967b36797b725e30e Mon Sep 17 00:00:00 2001 From: arvidn Date: Sun, 28 Feb 2016 16:05:13 -0500 Subject: [PATCH] attempt to fix issue where the partfile is not deleted when asking to delete all files --- src/storage.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/storage.cpp b/src/storage.cpp index 2ba8bbc6d..38b5e3da1 100644 --- a/src/storage.cpp +++ b/src/storage.cpp @@ -816,6 +816,11 @@ namespace libtorrent if (error && !ec) { ec.file = -1; ec.ec = error; ec.operation = storage_error::remove; } } + // if there's a part file open, make sure to destruct it to have it + // release the underlying part file. Otherwise we may not be able to + // delete it + if (m_part_file) m_part_file.reset(); + error_code error; remove(combine_path(m_save_path, m_part_file_name), error); DFLOG(stderr, "[%p] delete partfile %s/%s [%s]\n", static_cast(this)