From: Yehuda Sadeh Date: Thu, 3 Oct 2013 18:49:33 +0000 (-0700) Subject: librados: drop reference to completion in container destructor X-Git-Tag: v0.71~14^2~1 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=7ef5eb06ec07d4e7c3fee4d85de8a8310f7ed94f;p=ceph.git librados: drop reference to completion in container destructor Move the PoolAsyncCompletionImpl reference drop from C_PoolAsync_Safe::finish() to ~C_PoolAsyncSafe(), as finish() is only called when the async request is actually sent. Signed-off-by: Yehuda Sadeh Reviewed-by: Josh Durgin --- diff --git a/src/librados/PoolAsyncCompletionImpl.h b/src/librados/PoolAsyncCompletionImpl.h index efb896414662..443b2c23a17c 100644 --- a/src/librados/PoolAsyncCompletionImpl.h +++ b/src/librados/PoolAsyncCompletionImpl.h @@ -94,6 +94,9 @@ namespace librados { C_PoolAsync_Safe(PoolAsyncCompletionImpl *_c) : c(_c) { c->get(); } + ~C_PoolAsync_Safe() { + c->put(); + } void finish(int r) { c->lock.Lock(); @@ -109,7 +112,7 @@ namespace librados { c->lock.Lock(); } - c->put_unlock(); + c->lock.Unlock(); } }; }