From: Orit Wasserman Date: Mon, 9 Nov 2015 12:05:27 +0000 (+0100) Subject: rgw: use smart pointer for C_Reinitwatch X-Git-Tag: v10.0.1~7^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=refs%2Fpull%2F6767%2Fhead;p=ceph.git rgw: use smart pointer for C_Reinitwatch Fixes: 13529 Signed-off-by: Orit Wasserman --- diff --git a/src/rgw/rgw_rados.cc b/src/rgw/rgw_rados.cc index 8f5dcd487f4e..6e93beeea6a6 100644 --- a/src/rgw/rgw_rados.cc +++ b/src/rgw/rgw_rados.cc @@ -1305,6 +1305,7 @@ class RGWWatcher : public librados::WatchCtx2 { watcher->reinit(); } }; + shared_ptr reinit_watch; public: RGWWatcher(RGWRados *r, int i, const string& o) : rados(r), index(i), oid(o), watch_handle(0) {} void handle_notify(uint64_t notify_id, @@ -1325,7 +1326,8 @@ public: lderr(rados->ctx()) << "RGWWatcher::handle_error cookie " << cookie << " err " << cpp_strerror(err) << dendl; rados->remove_watcher(index); - rados->schedule_context(new C_ReinitWatch(this)); + reinit_watch.reset(new C_ReinitWatch(this)); + rados->schedule_context(reinit_watch.get()); } void reinit() {