From e842ff7ad517bdb0627f2bdc8d3294dd19cfbe58 Mon Sep 17 00:00:00 2001 From: Thad House Date: Sun, 22 May 2016 23:24:10 -0700 Subject: [PATCH] Explicitly stop the PIDController Notifier in the destructor (#48) This helps reduce the probability of a PID Controller Segmentation Fault. --- wpilibc/athena/src/PIDController.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/wpilibc/athena/src/PIDController.cpp b/wpilibc/athena/src/PIDController.cpp index 970a8159ab..58a1085b48 100644 --- a/wpilibc/athena/src/PIDController.cpp +++ b/wpilibc/athena/src/PIDController.cpp @@ -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); }