mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-06-21 01:01:43 +00:00
cscore: Change impl to only one singleton (#1398)
This avoids a number of shutdown use-after-free races by controlling the destruction order. It also is a prerequisite to making the internal interfaces mockable for unit testing.
This commit is contained in:
@@ -23,10 +23,7 @@ class Notifier {
|
||||
friend class NotifierTest;
|
||||
|
||||
public:
|
||||
static Notifier& GetInstance() {
|
||||
static Notifier instance;
|
||||
return instance;
|
||||
}
|
||||
Notifier();
|
||||
~Notifier();
|
||||
|
||||
void Start();
|
||||
@@ -62,8 +59,6 @@ class Notifier {
|
||||
void NotifyTelemetryUpdated();
|
||||
|
||||
private:
|
||||
Notifier();
|
||||
|
||||
class Thread;
|
||||
wpi::SafeThreadOwner<Thread> m_owner;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user