refactor
This commit is contained in:
parent
68a26d2bc6
commit
619d5939b3
@ -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<filesystem_item_evicted>(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");
|
||||
|
Loading…
x
Reference in New Issue
Block a user