From: Samuel Just Date: Tue, 19 Mar 2013 21:46:20 +0000 (-0700) Subject: shared_cache: clear lru in destructor X-Git-Tag: v0.62~191^2~8 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=6119f297dc9bed66f15bce151eac7a653e087f90;p=ceph.git 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 --- diff --git a/src/common/shared_cache.hpp b/src/common/shared_cache.hpp index 1bbfa0e354f..69a4c06dfbf 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;