1
0
Fork 0
mirror of https://github.com/halpz/re3.git synced 2025-06-24 16:31:26 +00:00
re3/src/leeds/base/singletonManager.cpp
2021-08-29 19:32:22 +03:00

36 lines
470 B
C++

#include "common.h"
#include "singletonManager.h"
namespace base
{
cSingletonManager& SingletonManager()
{
static cSingletonManager manager;
return manager;
}
cSingletonManager::~cSingletonManager()
{
Purge();
}
void cSingletonManager::Add(cSingletonBase* node)
{
node->next = head;
if (!head)
tail = node;
head = node;
}
void cSingletonManager::Purge()
{
for (cSingletonBase* node = tail; node; node = tail) {
tail = node->next;
delete node;
}
}
}