diff --git a/core/src/com/riiablo/item/PropertyList.java b/core/src/com/riiablo/item/PropertyList.java index 69f8c605..e1b2bca5 100644 --- a/core/src/com/riiablo/item/PropertyList.java +++ b/core/src/com/riiablo/item/PropertyList.java @@ -50,6 +50,7 @@ public class PropertyList implements Iterable { } public void clear() { + for (Stat stat : props.values()) Stat.free(stat); props.clear(); } diff --git a/core/src/com/riiablo/item/Stat.java b/core/src/com/riiablo/item/Stat.java index 0e55c296..2a8cd302 100644 --- a/core/src/com/riiablo/item/Stat.java +++ b/core/src/com/riiablo/item/Stat.java @@ -3,6 +3,7 @@ package com.riiablo.item; import com.google.common.primitives.UnsignedInts; import com.badlogic.gdx.Gdx; +import com.badlogic.gdx.utils.Array; import com.badlogic.gdx.utils.Pool; import com.badlogic.gdx.utils.Pools; import com.riiablo.CharData; @@ -475,6 +476,14 @@ public class Stat implements Comparable, Pool.Poolable { return POOL.obtain()._obtain(src); } + static void free(Stat stat) { + POOL.free(stat); + } + + static void freeAll(Array stats) { + POOL.freeAll(stats); + } + public int id; public int param; public ItemStatCost.Entry entry;