diff --git a/include/lol/util/ObjectManager.hpp b/include/lol/util/ObjectManager.hpp index dfe6fa2..257c4ba 100644 --- a/include/lol/util/ObjectManager.hpp +++ b/include/lol/util/ObjectManager.hpp @@ -56,6 +56,17 @@ namespace lol return it->second; } + inline void Return(unsigned int id) + { + auto it = objects.find(id); + + if (it == objects.end()) + return; + + if (it->second.use_count() < 3) // I hope I don't forget about this if I ever go multithreaded + objects.erase(it); + } + private: ObjectManager() {}