Merge "The LiveWindow instance isn't a global static"

This commit is contained in:
Jonathan Leitschuh (WPI)
2014-07-29 14:00:31 -07:00
committed by Gerrit Code Review
2 changed files with 4 additions and 9 deletions

View File

@@ -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;

View File

@@ -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;
}
/**