]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
rgw: use smart pointer for C_Reinitwatch 6767/head
authorOrit Wasserman <owasserm@redhat.com>
Mon, 9 Nov 2015 12:05:27 +0000 (13:05 +0100)
committerOrit Wasserman <owasserm@redhat.com>
Wed, 2 Dec 2015 10:16:05 +0000 (11:16 +0100)
Fixes: 13529
Signed-off-by: Orit Wasserman <owasserm@redhat.com>
src/rgw/rgw_rados.cc

index 8f5dcd487f4eb92af56717eae0482ccaa47aaeb4..6e93beeea6a6ff733080cb270ea625ae5a92ec13 100644 (file)
@@ -1305,6 +1305,7 @@ class RGWWatcher : public librados::WatchCtx2 {
         watcher->reinit();
       }
   };
+  shared_ptr<C_ReinitWatch> 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() {