Skip to content

Commit

Permalink
Fix memory leak that wait_set might be not destoryed in some case. (#423
Browse files Browse the repository at this point in the history
) (#426)

Signed-off-by: Chen.Lihui <[email protected]>
  • Loading branch information
Chen Lihui authored Aug 25, 2020
1 parent e2f0814 commit f54c74b
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions rmw_fastrtps_shared_cpp/src/listener_thread.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,11 @@ node_listener(rmw_context_t * context)
{
TERMINATE_THREAD("rmw_wait failed");
}
if (RMW_RET_OK != rmw_fastrtps_shared_cpp::__rmw_destroy_wait_set(
context->implementation_identifier, wait_set))
{
TERMINATE_THREAD("failed to destroy wait set");
}
if (subscriptions_buffer[0]) {
rmw_dds_common::msg::ParticipantEntitiesInfo msg;
bool taken;
Expand All @@ -168,10 +173,5 @@ node_listener(rmw_context_t * context)
common_context->graph_cache.update_participant_entities(msg);
}
}
if (RMW_RET_OK != rmw_fastrtps_shared_cpp::__rmw_destroy_wait_set(
context->implementation_identifier, wait_set))
{
TERMINATE_THREAD("failed to destroy wait set");
}
}
}

0 comments on commit f54c74b

Please sign in to comment.