Skip to content

Commit

Permalink
Only exchange intra_process waitable if nonnull (#1317)
Browse files Browse the repository at this point in the history
Signed-off-by: Stephen Brawner <brawner@gmail.com>
  • Loading branch information
brawner committed Oct 9, 2020
1 parent 31f2614 commit c357cc2
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions rclcpp/include/rclcpp/wait_set_template.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -233,9 +233,9 @@ class WaitSetTemplate final : private SynchronizationPolicy, private StoragePoli
}
if (mask.include_intra_process_waitable) {
auto local_waitable = inner_subscription->get_intra_process_waitable();
inner_subscription->exchange_in_use_by_wait_set_state(local_waitable.get(), false);
if (nullptr != local_waitable) {
// This is the case when intra process is disabled for the subscription.
// This is the case when intra process is enabled for the subscription.
inner_subscription->exchange_in_use_by_wait_set_state(local_waitable.get(), false);
this->storage_remove_waitable(std::move(local_waitable));
}
}
Expand Down

0 comments on commit c357cc2

Please sign in to comment.