RobotBase: Call cscore Shutdown() from destructor

This commit is contained in:
Peter Johnson
2018-11-07 00:02:28 -08:00
parent 563d5334c9
commit 1347218f21
2 changed files with 4 additions and 1 deletions

View File

@@ -10,6 +10,7 @@
#include <cstdio>
#include <cameraserver/CameraServerShared.h>
#include <cscore.h>
#include <hal/HAL.h>
#include <networktables/NetworkTableInstance.h>
@@ -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; }

View File

@@ -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.