Skip to content

Commit

Permalink
Set nullptr after delete
Browse files Browse the repository at this point in the history
Signed-off-by: Javier Santiago <javiersantiago@eprosima.com>
  • Loading branch information
jsan-rt authored and richiware committed Jul 15, 2022
1 parent 577da84 commit 4fa142e
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions rmw_fastrtps_shared_cpp/src/rmw_service.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,7 @@ __rmw_destroy_service(
// Delete DataReader listener
if (nullptr != info->listener_) {
delete info->listener_;
info->listener_ = nullptr;
}

// Delete DataWriter
Expand All @@ -122,6 +123,7 @@ __rmw_destroy_service(
// Delete DataWriter listener
if (nullptr != info->pub_listener_) {
delete info->pub_listener_;
info->pub_listener_ = nullptr;
}

// Delete topics and unregister types
Expand Down

0 comments on commit 4fa142e

Please sign in to comment.