Skip to content

Commit

Permalink
reflect the failure to get EDP readers
Browse files Browse the repository at this point in the history
Signed-off-by: Ethan Gao <ethan.gao@linux.intel.com>
  • Loading branch information
gaoethan committed Dec 15, 2017
1 parent 8413f3e commit e6941db
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions rmw_fastrtps_cpp/src/rmw_node.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -277,12 +277,17 @@ rmw_destroy_node(rmw_node_t * node)

// Begin deleting things in the same order they were created in rmw_create_node().
std::pair<StatefulReader *, StatefulReader *> edp_readers = participant->getEDPReaders();
if (!edp_readers.first || !edp_readers.first->setListener(nullptr)) {
if (!edp_readers.first || !edp_readers.second) {
RMW_SET_ERROR_MSG("failed to get EDPReader listener");
result_ret = RMW_RET_ERROR;
}

if (edp_readers.first && !edp_readers.first->setListener(nullptr)) {
RMW_SET_ERROR_MSG("failed to unset EDPReader listener");
result_ret = RMW_RET_ERROR;
}
delete impl->secondarySubListener;
if (!edp_readers.second || !edp_readers.second->setListener(nullptr)) {
if (edp_readers.second && !edp_readers.second->setListener(nullptr)) {
RMW_SET_ERROR_MSG("failed to unset EDPReader listener");
result_ret = RMW_RET_ERROR;
}
Expand Down

0 comments on commit e6941db

Please sign in to comment.