mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-06-19 00:41:43 +00:00
[command] Make cancel safe to call from initialize (#2440)
Fixes #2388.
This commit is contained in:
@@ -144,12 +144,12 @@ void CommandScheduler::Schedule(bool interruptible, Command* command) {
|
||||
}
|
||||
command->Initialize();
|
||||
m_impl->scheduledCommands[command] = CommandState{interruptible};
|
||||
for (auto&& action : m_impl->initActions) {
|
||||
action(*command);
|
||||
}
|
||||
for (auto&& requirement : requirements) {
|
||||
m_impl->requirements[requirement] = command;
|
||||
}
|
||||
for (auto&& action : m_impl->initActions) {
|
||||
action(*command);
|
||||
}
|
||||
m_watchdog.AddEpoch(command->GetName() + ".Initialize()");
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user