diff --git a/wpilibc/src/main/native/cpp/shuffleboard/Shuffleboard.cpp b/wpilibc/src/main/native/cpp/shuffleboard/Shuffleboard.cpp index 16b404c255..913501278f 100644 --- a/wpilibc/src/main/native/cpp/shuffleboard/Shuffleboard.cpp +++ b/wpilibc/src/main/native/cpp/shuffleboard/Shuffleboard.cpp @@ -63,10 +63,24 @@ void Shuffleboard::AddEventMarker(std::string_view name, AddEventMarker(name, "", importance); } -detail::ShuffleboardInstance& Shuffleboard::GetInstance() { - static detail::ShuffleboardInstance inst( +static std::unique_ptr& GetInstanceHolder() { + static std::unique_ptr instance = + std::make_unique( + nt::NetworkTableInstance::GetDefault()); + return instance; +} + +#ifndef __FRC_ROBORIO__ +namespace frc::impl { +void ResetShuffleboardInstance() { + GetInstanceHolder() = std::make_unique( nt::NetworkTableInstance::GetDefault()); - return inst; +} +} // namespace frc::impl +#endif + +detail::ShuffleboardInstance& Shuffleboard::GetInstance() { + return *GetInstanceHolder(); } detail::RecordingController& Shuffleboard::GetRecordingController() {