[wpilibc] Fix moved pneumatics objects not destructing properly (#4068)

This commit is contained in:
Thad House
2022-03-01 11:10:45 -08:00
committed by GitHub
parent 2668130e70
commit bc39a1a293
3 changed files with 9 additions and 3 deletions

View File

@@ -39,7 +39,9 @@ Solenoid::Solenoid(PneumaticsModuleType moduleType, int channel)
channel} {}
Solenoid::~Solenoid() {
m_module->UnreserveSolenoids(m_mask);
if (m_module) {
m_module->UnreserveSolenoids(m_mask);
}
}
void Solenoid::Set(bool on) {