From 3c04580a577b84ee8ce3276dc96fda5799dd9271 Mon Sep 17 00:00:00 2001 From: Ryan Blue Date: Wed, 30 Aug 2023 16:21:49 -0400 Subject: [PATCH] [commands] ProxyCommand: Use inner command name in unique_ptr constructor (#5570) --- .../src/main/native/cpp/frc2/command/ProxyCommand.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/wpilibNewCommands/src/main/native/cpp/frc2/command/ProxyCommand.cpp b/wpilibNewCommands/src/main/native/cpp/frc2/command/ProxyCommand.cpp index 9fe462ad2e..eb4fb7cab1 100644 --- a/wpilibNewCommands/src/main/native/cpp/frc2/command/ProxyCommand.cpp +++ b/wpilibNewCommands/src/main/native/cpp/frc2/command/ProxyCommand.cpp @@ -23,8 +23,10 @@ ProxyCommand::ProxyCommand(Command* command) SetName(std::string{"Proxy("}.append(command->GetName()).append(")")); } -ProxyCommand::ProxyCommand(std::unique_ptr command) - : ProxyCommand([command = std::move(command)] { return command.get(); }) {} +ProxyCommand::ProxyCommand(std::unique_ptr command) { + SetName(std::string{"Proxy("}.append(command->GetName()).append(")")); + m_supplier = [command = std::move(command)] { return command.get(); }; +} void ProxyCommand::Initialize() { m_command = m_supplier();