From 587c0559b582ca8694741d5d30ba621bca26f449 Mon Sep 17 00:00:00 2001 From: "Scott E. Graves" Date: Tue, 24 Dec 2024 21:29:14 -0600 Subject: [PATCH] refactor --- repertory/librepertory/src/file_manager/file_manager.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/repertory/librepertory/src/file_manager/file_manager.cpp b/repertory/librepertory/src/file_manager/file_manager.cpp index c68a3519..49deec24 100644 --- a/repertory/librepertory/src/file_manager/file_manager.cpp +++ b/repertory/librepertory/src/file_manager/file_manager.cpp @@ -558,13 +558,15 @@ auto file_manager::remove_file(const std::string &api_path) -> api_error { upload_notify_.notify_all(); upload_lock.unlock(); - recur_mutex_lock open_lock(open_file_mtx_); + unique_recur_mutex_lock open_lock(open_file_mtx_); res = provider_.remove_file(api_path); if (res != api_error::success) { return res; } + open_lock.unlock(); + remove_source_and_shrink_cache(api_path, fsi.source_path, fsi.size, allocated); return api_error::success;