]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
librados: decrement refcount of old io_ctx_impl in assignment operator
authorJosh Durgin <josh.durgin@dreamhost.com>
Tue, 1 Mar 2011 19:35:41 +0000 (11:35 -0800)
committerJosh Durgin <josh.durgin@dreamhost.com>
Tue, 1 Mar 2011 19:35:41 +0000 (11:35 -0800)
Signed-off-by: Josh Durgin <josh.durgin@dreamhost.com>
src/librados.cc

index e67367e6deacbf3384140608b598ec01bec16623..643eec9cc218aade3cd58be1ee19a9567ed33432 100644 (file)
@@ -2017,6 +2017,9 @@ IoCtx(const IoCtx& rhs)
 librados::IoCtx& librados::IoCtx::
 operator=(const IoCtx& rhs)
 {
+  if (io_ctx_impl)
+    io_ctx_impl->ref_cnt--;
+
   io_ctx_impl = rhs.io_ctx_impl;
   io_ctx_impl->ref_cnt++;
   return *this;