diff --git a/repertory/librepertory/src/file_manager/open_file.cpp b/repertory/librepertory/src/file_manager/open_file.cpp index 93801587..a7a41661 100644 --- a/repertory/librepertory/src/file_manager/open_file.cpp +++ b/repertory/librepertory/src/file_manager/open_file.cpp @@ -474,11 +474,14 @@ auto open_file::close() -> bool { } } + if (err != api_error::success || read_state_.all()) { + mgr_.remove_resume(get_api_path(), get_source_path()); + } + if (err == api_error::success) { return true; } - mgr_.remove_resume(get_api_path(), get_source_path()); if (not utils::file::file(fsi_.source_path).remove()) { utils::error::raise_api_path_error( function_name, get_api_path(), fsi_.source_path,