diff --git a/src/Insight/Insight.cpp b/src/Insight/Insight.cpp index addd97ab..03d70d66 100644 --- a/src/Insight/Insight.cpp +++ b/src/Insight/Insight.cpp @@ -354,8 +354,10 @@ namespace Bloom if (event.state == TargetControllerState::SUSPENDED) { emit this->insightSignals->targetControllerSuspended(); + return; + } - } else if (event.state == TargetControllerState::ACTIVE) { + if (event.state == TargetControllerState::ACTIVE) { auto* getTargetDescriptorTask = new GetTargetDescriptor(); QObject::connect( diff --git a/src/TargetController/TargetControllerComponent.hpp b/src/TargetController/TargetControllerComponent.hpp index 311f1d16..f753a350 100644 --- a/src/TargetController/TargetControllerComponent.hpp +++ b/src/TargetController/TargetControllerComponent.hpp @@ -165,12 +165,15 @@ namespace Bloom::TargetController */ template void registerCommandHandler(std::function(CommandType&)> callback) { - auto parentCallback = [callback] (Commands::Command& command) { - // Downcast the command to the expected type - return callback(dynamic_cast(command)); - }; - - this->commandHandlersByCommandType.insert(std::pair(CommandType::type, parentCallback)); + this->commandHandlersByCommandType.insert( + std::pair( + CommandType::type, + [callback] (Commands::Command& command) { + // Downcast the command to the expected type + return callback(dynamic_cast(command)); + } + ) + ); } /**