diff --git a/src/ObjectPool.h b/src/ObjectPool.h index 2219088..3e80a2f 100644 --- a/src/ObjectPool.h +++ b/src/ObjectPool.h @@ -9,7 +9,7 @@ class ObjectPool { public: using ptr_type = std::unique_ptr>; - ObjectPool(std::function createObject) : + ObjectPool(std::function()> createObject) : createObject(createObject) {} @@ -19,7 +19,7 @@ public: std::lock_guard lock(poolMutex); if (pool.empty()) { - pool.push(std::unique_ptr(createObject())); + pool.push(createObject()); } ptr_type tmp(pool.top().release(), [this](T* p) {