mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-06-19 00:41:43 +00:00
[wpilibc] Check for invalid handle in destructors (#7212)
Moved-from objects have invalid handles.
This commit is contained in:
@@ -90,10 +90,11 @@ TimedRobot::TimedRobot(units::second_t period) : IterativeRobotBase(period) {
|
||||
}
|
||||
|
||||
TimedRobot::~TimedRobot() {
|
||||
int32_t status = 0;
|
||||
|
||||
HAL_StopNotifier(m_notifier, &status);
|
||||
FRC_ReportError(status, "StopNotifier");
|
||||
if (m_notifier != HAL_kInvalidHandle) {
|
||||
int32_t status = 0;
|
||||
HAL_StopNotifier(m_notifier, &status);
|
||||
FRC_ReportError(status, "StopNotifier");
|
||||
}
|
||||
}
|
||||
|
||||
void TimedRobot::AddPeriodic(std::function<void()> callback,
|
||||
|
||||
Reference in New Issue
Block a user