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;