From: John Spray Date: Thu, 8 Sep 2016 17:35:15 +0000 (+0100) Subject: libcephfs: take ref when constructed with CephContext X-Git-Tag: v11.1.0~543^2~1 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=7861a84b75e532a0c2285dec2ba8835f7e3bfa96;p=ceph.git libcephfs: take ref when constructed with CephContext 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 --- diff --git a/src/libcephfs.cc b/src/libcephfs.cc index cc8af424d35f..a6e9a6e8ccf8 100644 --- a/src/libcephfs.cc +++ b/src/libcephfs.cc @@ -46,6 +46,9 @@ public: messenger(NULL), cct(cct_) { + if (cct_ != nullptr) { + cct->get(); + } } ~ceph_mount_info()