added cleanup
This commit is contained in:
parent
7c16ca7913
commit
48d2dbcb7e
|
@ -56,6 +56,15 @@ namespace lol
|
|||
return it->second;
|
||||
}
|
||||
|
||||
inline void Cleanup()
|
||||
{
|
||||
for(auto& [key, val] : objects)
|
||||
{
|
||||
if (val.use_count() < 3) // I hope I don't forget about this if I ever go multithreaded
|
||||
objects.erase(key);
|
||||
}
|
||||
}
|
||||
|
||||
inline void Return(unsigned int id)
|
||||
{
|
||||
auto it = objects.find(id);
|
||||
|
|
Loading…
Reference in a new issue