Skip to content

Commit

Permalink
Merge pull request #6767 from oritwas/wip-13529-jewel
Browse files Browse the repository at this point in the history
rgw: use smart pointer for C_Reinitwatch

Reviewed-by: Yehuda Sadeh <yehuda@redhat.com>
  • Loading branch information
yehudasa committed Dec 3, 2015
2 parents fac0809 + e9daed2 commit 0857da4
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/rgw/rgw_rados.cc
Expand Up @@ -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,
Expand All @@ -1325,7 +1326,8 @@ class RGWWatcher : public librados::WatchCtx2 {
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() {
Expand Down

0 comments on commit 0857da4

Please sign in to comment.