diff --git a/repertory/librepertory/src/file_manager/file_manager.cpp b/repertory/librepertory/src/file_manager/file_manager.cpp index 390b6a29..c2f6b47c 100644 --- a/repertory/librepertory/src/file_manager/file_manager.cpp +++ b/repertory/librepertory/src/file_manager/file_manager.cpp @@ -146,8 +146,9 @@ void file_manager::close_all(const std::string &api_path) { } auto closeable_file = file_iter->second; - closeable_file->remove_all(); open_file_lookup_.erase(api_path); + + closeable_file->remove_all(); closeable_file.reset(); } @@ -235,7 +236,7 @@ auto file_manager::evict_file(const std::string &api_path) -> bool { open_file_lookup_.erase(api_path); - auto removed = utils::file::file(source_path).remove(); + auto removed = utils::file::file{source_path}.remove(); if (removed) { event_system::instance().raise(api_path, source_path); @@ -549,7 +550,7 @@ auto file_manager::remove_file(const std::string &api_path) -> api_error { return res; } - if (not utils::file::file(fsi.source_path).remove()) { + if (not utils::file::file{fsi.source_path}.remove()) { utils::error::raise_api_path_error( function_name, fsi.api_path, fsi.source_path, utils::get_last_error_code(), "failed to delete source");