From 13496c75b441496bc7816cd5d3a5ef1a870db2eb Mon Sep 17 00:00:00 2001 From: Austin Schuh Date: Thu, 3 Dec 2015 00:44:17 -0800 Subject: [PATCH] Fixed double free of DriverStation. DriverStation was being added to the singletons and also as a const member variable. This made it so that on program exit, it was getting double freed. Change-Id: I87f8260615dc31d57ce7c7204c1dfde22973ad51 --- wpilibc/Athena/src/DriverStation.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/wpilibc/Athena/src/DriverStation.cpp b/wpilibc/Athena/src/DriverStation.cpp index 455a9874e5..35559d2781 100644 --- a/wpilibc/Athena/src/DriverStation.cpp +++ b/wpilibc/Athena/src/DriverStation.cpp @@ -88,8 +88,8 @@ void DriverStation::Run() { * @return Pointer to the DS instance */ DriverStation &DriverStation::GetInstance() { - static DriverStation instance; - return instance; + static DriverStation *instance = new DriverStation(); + return *instance; } /**