mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-07-03 03:01:44 +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;
|
bool isSensor;
|
||||||
|
|
||||||
LiveWindowComponent()
|
LiveWindowComponent()
|
||||||
{}//WTF?
|
{}
|
||||||
LiveWindowComponent(std::string subsystem, std::string name, bool isSensor)
|
LiveWindowComponent(std::string subsystem, std::string name, bool isSensor)
|
||||||
{
|
{
|
||||||
this->subsystem = subsystem;
|
this->subsystem = subsystem;
|
||||||
@@ -54,7 +54,6 @@ private:
|
|||||||
std::vector<LiveWindowSendable *> m_sensors;
|
std::vector<LiveWindowSendable *> m_sensors;
|
||||||
std::map<LiveWindowSendable *, LiveWindowComponent> m_components;
|
std::map<LiveWindowSendable *, LiveWindowComponent> m_components;
|
||||||
|
|
||||||
static LiveWindow *m_instance;
|
|
||||||
ITable *m_liveWindowTable;
|
ITable *m_liveWindowTable;
|
||||||
ITable *m_statusTable;
|
ITable *m_statusTable;
|
||||||
|
|
||||||
|
|||||||
@@ -3,8 +3,6 @@
|
|||||||
#include <algorithm>
|
#include <algorithm>
|
||||||
#include <sstream>
|
#include <sstream>
|
||||||
|
|
||||||
LiveWindow* LiveWindow::m_instance = NULL;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get an instance of the LiveWindow main class
|
* Get an instance of the LiveWindow main class
|
||||||
* This is a singleton to guarantee that there is only a single instance regardless of
|
* 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()
|
LiveWindow * LiveWindow::GetInstance()
|
||||||
{
|
{
|
||||||
if (m_instance == NULL)
|
static LiveWindow* instance = new LiveWindow();
|
||||||
{
|
|
||||||
m_instance = new LiveWindow();
|
return instance;
|
||||||
}
|
|
||||||
return m_instance;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
Reference in New Issue
Block a user