Move main non Thread Objects to Smart Pointers

This commit is contained in:
LordGrey
2024-01-01 18:37:49 +01:00
parent 6df45507bf
commit 26102ca963
12 changed files with 166 additions and 243 deletions

View File

@@ -7,6 +7,8 @@
#include <utils/Process.h>
#include <hyperion/HyperionIManager.h>
QScopedPointer<EventHandler> EventHandler::instance;
EventHandler::EventHandler()
: _isSuspended(false)
, _isIdle(false)
@@ -22,10 +24,14 @@ EventHandler::~EventHandler()
QObject::disconnect(this, &EventHandler::signalEvent, HyperionIManager::getInstance(), &HyperionIManager::handleEvent);
}
EventHandler* EventHandler::getInstance()
QScopedPointer<EventHandler>& EventHandler::getInstance()
{
static EventHandler instance;
return &instance;
if (!instance)
{
instance.reset(new EventHandler());
}
return instance;
}
void EventHandler::suspend()