diff --git a/repertory/librepertory/src/file_manager/open_file.cpp b/repertory/librepertory/src/file_manager/open_file.cpp index 0d0fc373..720f6c81 100644 --- a/repertory/librepertory/src/file_manager/open_file.cpp +++ b/repertory/librepertory/src/file_manager/open_file.cpp @@ -197,17 +197,8 @@ auto open_file::close() -> bool { return true; } - if (allocated) { - file_manager::remove_source_and_shrink_cache( - fsi_.api_path, fsi_.source_path, fsi_.size, allocated); - } else { - auto file = utils::file::file{fsi_.source_path}; - if (not file.remove()) { - utils::error::raise_api_path_error( - function_name, fsi_.api_path, fsi_.source_path, - utils::get_last_error_code(), "failed to delete source file"); - } - } + file_manager::remove_source_and_shrink_cache(fsi_.api_path, fsi_.source_path, + fsi_.size, allocated); auto parent = utils::path::get_parent_path(fsi_.source_path); fsi_.source_path =