Skip to content

Commit 374deb9

Browse files
authored
Only exchange intra_process waitable if nonnull (#1317)
Signed-off-by: Stephen Brawner <[email protected]>
1 parent d0d12f7 commit 374deb9

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

rclcpp/include/rclcpp/wait_set_template.hpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -233,9 +233,9 @@ class WaitSetTemplate final : private SynchronizationPolicy, private StoragePoli
233233
}
234234
if (mask.include_intra_process_waitable) {
235235
auto local_waitable = inner_subscription->get_intra_process_waitable();
236-
inner_subscription->exchange_in_use_by_wait_set_state(local_waitable.get(), false);
237236
if (nullptr != local_waitable) {
238-
// This is the case when intra process is disabled for the subscription.
237+
// This is the case when intra process is enabled for the subscription.
238+
inner_subscription->exchange_in_use_by_wait_set_state(local_waitable.get(), false);
239239
this->storage_remove_waitable(std::move(local_waitable));
240240
}
241241
}

0 commit comments

Comments
 (0)