From 153d426573a85aff064316d87356fc9b0f153a93 Mon Sep 17 00:00:00 2001 From: OlleKR Date: Wed, 22 Oct 2025 10:42:24 +0200 Subject: [PATCH] fix: Make objectpools mSet variable add new objects behind if-statement --- src/ds/tools/ObjectPool.hx | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/ds/tools/ObjectPool.hx b/src/ds/tools/ObjectPool.hx index 91a027b..e992e8a 100644 --- a/src/ds/tools/ObjectPool.hx +++ b/src/ds/tools/ObjectPool.hx @@ -140,7 +140,6 @@ class ObjectPool { #if debug assert(!mSet.has(obj), 'object $obj was returned twice to the pool'); - mSet.set(obj); #end if (size == maxSize) @@ -149,6 +148,9 @@ class ObjectPool { if (size == mCapacity) resize(); mPool.set(size++, obj); + #if debug + mSet.set(obj); + #end } }