Skip to content

Commit

Permalink
Also check is_shutdown
Browse files Browse the repository at this point in the history
Signed-off-by: Yadunund <[email protected]>
  • Loading branch information
Yadunund committed Sep 19, 2024
1 parent 3ac3ec2 commit a9e995f
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion rmw_zenoh_cpp/src/rmw_zenoh.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -326,7 +326,7 @@ rmw_destroy_node(rmw_node_t * node)
// Erase the node from the set of session_nodes and close the Zenoh
// session if this is the last node.
node->context->impl->session_nodes_.erase(node);
if (node->context->impl->session_nodes_.empty()) {
if (node->context->impl->session_nodes_.empty() && node->context->impl->is_shutdown) {
// Close the zenoh session
if (z_close(z_move(node->context->impl->session), NULL) != Z_OK) {
RMW_SET_ERROR_MSG("Error while closing zenoh session");
Expand Down

0 comments on commit a9e995f

Please sign in to comment.