diff --git a/src/util/ObjectsPool.hpp b/src/util/ObjectsPool.hpp index 0dc97fd2..55238959 100644 --- a/src/util/ObjectsPool.hpp +++ b/src/util/ObjectsPool.hpp @@ -39,6 +39,7 @@ namespace util { freeObjects.pop(); new (ptr)T(std::forward(args)...); return std::shared_ptr(reinterpret_cast(ptr), [this](T* ptr) { + ptr->~T(); std::lock_guard lock(mutex); freeObjects.push(ptr); });