fix obj pool interface

master
Francisco 4 years ago committed by Francisco Paisana
parent 344bdf3165
commit a780a6a7b6

@ -27,10 +27,8 @@ public:
explicit pool_deallocator(obj_pool_itf<T>* pool_ = nullptr) : pool(pool_) {} explicit pool_deallocator(obj_pool_itf<T>* pool_ = nullptr) : pool(pool_) {}
void operator()(void* ptr) void operator()(void* ptr)
{ {
if (ptr != nullptr) { // dtor is not called, as object is going to be recycled
static_cast<T*>(ptr)->~T(); pool->do_deallocate(ptr);
pool->do_deallocate(ptr);
}
} }
}; };
using object_type = T; using object_type = T;

Loading…
Cancel
Save