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
)

Signed-off-by: Chen.Lihui <lihui.chen@sony.com>
  • Loading branch information
Chen Lihui authored Aug 24, 2020
1 parent 0d039e6 commit 0959c84
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 0959c84

Please sign in to comment.