mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-06-20 00:51:42 +00:00
Explicitly stop the PIDController Notifier in the destructor (#48)
This helps reduce the probability of a PID Controller Segmentation Fault.
This commit is contained in:
committed by
Peter Johnson
parent
21b1e39b2a
commit
e842ff7ad5
@@ -78,6 +78,8 @@ void PIDController::Initialize(float Kp, float Ki, float Kd, float Kf,
|
||||
}
|
||||
|
||||
PIDController::~PIDController() {
|
||||
//forcefully stopping the notifier so the callback can successfully run.
|
||||
m_controlLoop->Stop();
|
||||
if (m_table != nullptr) m_table->RemoveTableListener(this);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user