Signed-off-by: Yehuda Sadeh <yehuda@redhat.com>
void shutdown() override;
std::map<int, ShutdownCB *> shutdown_cbs;
- std::atomic<int> handles_counter;
+ std::atomic<int> handles_counter{0};
protected:
void init() {}
}
shutdown_cb = new RGWSI_Notify_ShutdownCB(this);
- finisher_svc->register_caller(shutdown_cb, &finisher_handle);
+ int handle;
+ finisher_svc->register_caller(shutdown_cb, &handle);
+ finisher_handle = handle;
return 0;
}
return;
}
- finisher_svc->unregister_caller(finisher_handle);
+ if (finisher_handle) {
+ finisher_svc->unregister_caller(*finisher_handle);
+ }
finalize_watch();
delete shutdown_cb;
CB *cb{nullptr};
- int finisher_handle{0};
+ std::optional<int> finisher_handle;
RGWSI_Notify_ShutdownCB *shutdown_cb{nullptr};
bool finalized{false};