Skip to content

Commit

Permalink
Merge pull request #76 from hkadayam/pass_event_handler_2
Browse files Browse the repository at this point in the history
Added safety access to ManagerImpl in case of shutdown
  • Loading branch information
hkadayam authored Mar 6, 2024
2 parents b9566ad + 84bb763 commit 7e8cdeb
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/lib/manager_impl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -366,7 +366,8 @@ nuraft::cb_func::ReturnCode mesg_state_mgr::internal_raft_event_handler(group_id
nuraft::cb_func::Type type,
nuraft::cb_func::Param* param) {
if (auto const [handled, ret] = handle_raft_event(type, param); handled) { return ret; }
return m_manager.lock()->generic_raft_event_handler(group_id, type, param);
if (auto sp = m_manager.lock(); sp) { return sp->generic_raft_event_handler(group_id, type, param); }
return nuraft::cb_func::Ok;
}

std::shared_ptr< Manager > init_messaging(Manager::Params const& p, std::weak_ptr< MessagingApplication > w,
Expand Down

0 comments on commit 7e8cdeb

Please sign in to comment.