This commit is contained in:
Scott E. Graves 2024-11-07 14:22:03 -06:00
parent 68a26d2bc6
commit 619d5939b3

View File

@ -146,8 +146,9 @@ void file_manager::close_all(const std::string &api_path) {
} }
auto closeable_file = file_iter->second; auto closeable_file = file_iter->second;
closeable_file->remove_all();
open_file_lookup_.erase(api_path); open_file_lookup_.erase(api_path);
closeable_file->remove_all();
closeable_file.reset(); closeable_file.reset();
} }
@ -235,7 +236,7 @@ auto file_manager::evict_file(const std::string &api_path) -> bool {
open_file_lookup_.erase(api_path); open_file_lookup_.erase(api_path);
auto removed = utils::file::file(source_path).remove(); auto removed = utils::file::file{source_path}.remove();
if (removed) { if (removed) {
event_system::instance().raise<filesystem_item_evicted>(api_path, event_system::instance().raise<filesystem_item_evicted>(api_path,
source_path); source_path);
@ -549,7 +550,7 @@ auto file_manager::remove_file(const std::string &api_path) -> api_error {
return res; 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( utils::error::raise_api_path_error(
function_name, fsi.api_path, fsi.source_path, function_name, fsi.api_path, fsi.source_path,
utils::get_last_error_code(), "failed to delete source"); utils::get_last_error_code(), "failed to delete source");