From 55500dbeff0241a518ae10b6c823a94ed6e87ae6 Mon Sep 17 00:00:00 2001 From: assiduous Date: Mon, 14 Oct 2024 21:53:12 -0700 Subject: [PATCH] ObjectsRegistry: added Clear() method --- Common/interface/ObjectsRegistry.hpp | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/Common/interface/ObjectsRegistry.hpp b/Common/interface/ObjectsRegistry.hpp index ce5f5411e..dcab0a0b9 100644 --- a/Common/interface/ObjectsRegistry.hpp +++ b/Common/interface/ObjectsRegistry.hpp @@ -264,6 +264,14 @@ class ObjectsRegistry } } + /// Removes all objects from the cache. + void Clear() + { + std::lock_guard Guard{m_CacheMtx}; + m_Cache.clear(); + m_NumRequestsSinceLastPurge.store(0); + } + private: class ObjectWrapper {