From b8cf3ecf998ece0275757999c788ec1912ea7977 Mon Sep 17 00:00:00 2001 From: Mason Reed Date: Sat, 26 Apr 2025 15:23:56 -0400 Subject: [SharedCache] Update the ref count warning to only show when above 2 We will have 2 live references in the DeleteController function, this warning does not need to be shown. --- view/sharedcache/core/SharedCacheController.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'view/sharedcache/core/SharedCacheController.cpp') diff --git a/view/sharedcache/core/SharedCacheController.cpp b/view/sharedcache/core/SharedCacheController.cpp index 6e275b4b..41118d7a 100644 --- a/view/sharedcache/core/SharedCacheController.cpp +++ b/view/sharedcache/core/SharedCacheController.cpp @@ -33,7 +33,8 @@ void DeleteController(const FileMetadata& file) { auto controller = it->second; // Someone is still holding the controller, lets warn about this. - if (controller->m_refs > 1) + // 2 is expected here because we have one held in `controllers` and one held by `controller`. + if (controller->m_refs > 2) LogWarn("Deleting SharedCacheController for view %llx, but there are still %d references", id, controller->m_refs.load()); -- cgit v1.3.1