We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 874e930 commit a8c3f81Copy full SHA for a8c3f81
cpp/frc2/command/CommandScheduler.cpp
@@ -84,6 +84,8 @@ CommandScheduler::~CommandScheduler() {
84
auto scheduler = frc::LiveWindow::GetInstance();
85
scheduler->enabled = nullptr;
86
scheduler->disabled = nullptr;
87
+
88
+ std::unique_ptr<Impl>().swap(m_impl);
89
}
90
91
CommandScheduler& CommandScheduler::GetInstance() {
@@ -312,6 +314,10 @@ Command* CommandScheduler::GetDefaultCommand(const Subsystem* subsystem) const {
312
314
313
315
316
void CommandScheduler::Cancel(Command* command) {
317
+ if (!m_impl) {
318
+ return;
319
+ }
320
321
if (m_impl->inRunLoop) {
322
m_impl->toCancel.emplace_back(command);
323
return;
0 commit comments