mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-06-19 00:41:43 +00:00
Merge "The LiveWindow instance isn't a global static"
This commit is contained in:
committed by
Gerrit Code Review
commit
dc42a1129f
@@ -14,7 +14,7 @@ struct LiveWindowComponent
|
||||
bool isSensor;
|
||||
|
||||
LiveWindowComponent()
|
||||
{}//WTF?
|
||||
{}
|
||||
LiveWindowComponent(std::string subsystem, std::string name, bool isSensor)
|
||||
{
|
||||
this->subsystem = subsystem;
|
||||
@@ -54,7 +54,6 @@ private:
|
||||
std::vector<LiveWindowSendable *> m_sensors;
|
||||
std::map<LiveWindowSendable *, LiveWindowComponent> m_components;
|
||||
|
||||
static LiveWindow *m_instance;
|
||||
ITable *m_liveWindowTable;
|
||||
ITable *m_statusTable;
|
||||
|
||||
|
||||
@@ -3,8 +3,6 @@
|
||||
#include <algorithm>
|
||||
#include <sstream>
|
||||
|
||||
LiveWindow* LiveWindow::m_instance = NULL;
|
||||
|
||||
/**
|
||||
* Get an instance of the LiveWindow main class
|
||||
* This is a singleton to guarantee that there is only a single instance regardless of
|
||||
@@ -12,11 +10,9 @@ LiveWindow* LiveWindow::m_instance = NULL;
|
||||
*/
|
||||
LiveWindow * LiveWindow::GetInstance()
|
||||
{
|
||||
if (m_instance == NULL)
|
||||
{
|
||||
m_instance = new LiveWindow();
|
||||
}
|
||||
return m_instance;
|
||||
static LiveWindow* instance = new LiveWindow();
|
||||
|
||||
return instance;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user