fix: ObjectsPool missing destructor call

This commit is contained in:
MihailRis 2025-11-18 22:25:04 +03:00
parent b1312c354d
commit c951d787b7

View File

@ -39,6 +39,7 @@ namespace util {
freeObjects.pop();
new (ptr)T(std::forward<Args>(args)...);
return std::shared_ptr<T>(reinterpret_cast<T*>(ptr), [this](T* ptr) {
ptr->~T();
std::lock_guard lock(mutex);
freeObjects.push(ptr);
});