diff --git a/irobot_events_executor/src/rclcpp/executors/events_executor/events_executor.cpp b/irobot_events_executor/src/rclcpp/executors/events_executor/events_executor.cpp index b3556f9..a4f7193 100644 --- a/irobot_events_executor/src/rclcpp/executors/events_executor/events_executor.cpp +++ b/irobot_events_executor/src/rclcpp/executors/events_executor/events_executor.cpp @@ -53,7 +53,7 @@ EventsExecutor::EventsExecutor( EventsExecutor::~EventsExecutor() { spinning.store(false); -}; +} void EventsExecutor::spin() diff --git a/irobot_events_executor/src/rclcpp/executors/events_executor/events_executor_entities_collector.cpp b/irobot_events_executor/src/rclcpp/executors/events_executor/events_executor_entities_collector.cpp index fe997b0..91bce2c 100644 --- a/irobot_events_executor/src/rclcpp/executors/events_executor/events_executor_entities_collector.cpp +++ b/irobot_events_executor/src/rclcpp/executors/events_executor/events_executor_entities_collector.cpp @@ -180,6 +180,7 @@ EventsExecutorEntitiesCollector::set_callback_group_entities_callbacks( // Set callbacks for all other entity types group->find_subscription_ptrs_if( [this](const rclcpp::SubscriptionBase::SharedPtr & subscription) { + assert(this != nullptr); if (subscription) { weak_subscriptions_map_.emplace(subscription.get(), subscription); @@ -389,9 +390,11 @@ std::function EventsExecutorEntitiesCollector::create_entity_callback( void * exec_entity_id, ExecutorEventType event_type) { - auto callback = [this, exec_entity_id, event_type](size_t num_events) { + assert(this != nullptr); + std::function callback = [this, exec_entity_id, event_type](size_t num_events) { + assert(this != nullptr); ExecutorEvent event = {exec_entity_id, -1, event_type, num_events}; - associated_executor_->events_queue_->enqueue(event); + this->associated_executor_->events_queue_->enqueue(event); }; return callback; } @@ -399,7 +402,7 @@ EventsExecutorEntitiesCollector::create_entity_callback( std::function EventsExecutorEntitiesCollector::create_waitable_callback(void * exec_entity_id) { - auto callback = [this, exec_entity_id](size_t num_events, int gen_entity_id) { + std::function callback = [this, exec_entity_id](size_t num_events, int gen_entity_id) { ExecutorEvent event = {exec_entity_id, gen_entity_id, ExecutorEventType::WAITABLE_EVENT, num_events}; associated_executor_->events_queue_->enqueue(event);