]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
libcephfs: take ref when constructed with CephContext
authorJohn Spray <john.spray@redhat.com>
Thu, 8 Sep 2016 17:35:15 +0000 (18:35 +0100)
committerJohn Spray <john.spray@redhat.com>
Wed, 19 Oct 2016 22:03:13 +0000 (23:03 +0100)
Previously, if you used ceph_create_with_context, then
it would try and destroy your context when you called
ceph_release.  Bad behaviour: caller created the
context, caller should decide when to destroy it.

Signed-off-by: John Spray <john.spray@redhat.com>
src/libcephfs.cc

index cc8af424d35f58d7614b634dfee1ec79b36a72ad..a6e9a6e8ccf8e680b8d7435ef6fc07279e61d56c 100644 (file)
@@ -46,6 +46,9 @@ public:
       messenger(NULL),
       cct(cct_)
   {
+    if (cct_ != nullptr) {
+      cct->get();
+    }
   }
 
   ~ceph_mount_info()