fix: ObjectsPool missing destructor call
This commit is contained in:
parent
b1312c354d
commit
c951d787b7
@ -39,6 +39,7 @@ namespace util {
|
|||||||
freeObjects.pop();
|
freeObjects.pop();
|
||||||
new (ptr)T(std::forward<Args>(args)...);
|
new (ptr)T(std::forward<Args>(args)...);
|
||||||
return std::shared_ptr<T>(reinterpret_cast<T*>(ptr), [this](T* ptr) {
|
return std::shared_ptr<T>(reinterpret_cast<T*>(ptr), [this](T* ptr) {
|
||||||
|
ptr->~T();
|
||||||
std::lock_guard lock(mutex);
|
std::lock_guard lock(mutex);
|
||||||
freeObjects.push(ptr);
|
freeObjects.push(ptr);
|
||||||
});
|
});
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user