From 6119f297dc9bed66f15bce151eac7a653e087f90 Mon Sep 17 00:00:00 2001 From: Samuel Just Date: Tue, 19 Mar 2013 14:46:20 -0700 Subject: [PATCH] shared_cache: clear lru in destructor Otherwise, the live references will attempt to extricate themselves from a disolving SharedLRU instance as the member destructors run. Signed-off-by: Samuel Just --- src/common/shared_cache.hpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/common/shared_cache.hpp b/src/common/shared_cache.hpp index 1bbfa0e354f2d..69a4c06dfbf5f 100644 --- a/src/common/shared_cache.hpp +++ b/src/common/shared_cache.hpp @@ -78,6 +78,12 @@ class SharedLRU { public: SharedLRU(size_t max_size = 20) : lock("SharedLRU::lock"), max_size(max_size) {} + + ~SharedLRU() { + contents.clear(); + lru.clear(); + assert(weak_refs.empty()); + } void set_size(size_t new_size) { list to_release; -- 2.39.5