From 43d188a42944ca7040f4173c09fef996c011b599 Mon Sep 17 00:00:00 2001 From: Peter Johnson Date: Wed, 7 Nov 2018 00:02:28 -0800 Subject: [PATCH] RobotBase: Call cscore Shutdown() from destructor --- wpilibc/src/main/native/cpp/RobotBase.cpp | 3 +++ wpilibc/src/main/native/include/frc/RobotBase.h | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/wpilibc/src/main/native/cpp/RobotBase.cpp b/wpilibc/src/main/native/cpp/RobotBase.cpp index da30c03612..17425bcaae 100644 --- a/wpilibc/src/main/native/cpp/RobotBase.cpp +++ b/wpilibc/src/main/native/cpp/RobotBase.cpp @@ -10,6 +10,7 @@ #include #include +#include #include #include @@ -117,4 +118,6 @@ RobotBase::RobotBase() : m_ds(DriverStation::GetInstance()) { RobotBase::RobotBase(RobotBase&&) : m_ds(DriverStation::GetInstance()) {} +RobotBase::~RobotBase() { cs::Shutdown(); } + RobotBase& RobotBase::operator=(RobotBase&&) { return *this; } diff --git a/wpilibc/src/main/native/include/frc/RobotBase.h b/wpilibc/src/main/native/include/frc/RobotBase.h index 45433f9e0e..eee07d66f7 100644 --- a/wpilibc/src/main/native/include/frc/RobotBase.h +++ b/wpilibc/src/main/native/include/frc/RobotBase.h @@ -127,7 +127,7 @@ class RobotBase { */ RobotBase(); - virtual ~RobotBase() = default; + virtual ~RobotBase(); // m_ds isn't moved in these because DriverStation is a singleton; every // instance of RobotBase has a reference to the same object.