From: Sage Weil Date: Tue, 1 Jul 2014 22:51:06 +0000 (-0700) Subject: common/RefCountedObject: assert nref == 0 in dtor X-Git-Tag: v0.84~148^2~6 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=45991c055bc949f6b81f93c25e674e60fc7649e7;p=ceph.git common/RefCountedObject: assert nref == 0 in dtor Signed-off-by: Sage Weil --- diff --git a/src/common/RefCountedObj.h b/src/common/RefCountedObj.h index ca405693081..395a4368734 100644 --- a/src/common/RefCountedObj.h +++ b/src/common/RefCountedObj.h @@ -24,7 +24,9 @@ struct RefCountedObject { atomic_t nref; CephContext *cct; RefCountedObject(CephContext *c = NULL, int n=1) : nref(n), cct(c) {} - virtual ~RefCountedObject() {} + virtual ~RefCountedObject() { + assert(nref.read() == 0); + } RefCountedObject *get() { int v = nref.inc();