From 5c05c9f1d1b61c05a78646f72786f643802178cd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=8D=97=E9=97=A8=E9=98=B3=E5=BE=B7?= <66559840+nanmenyangde@users.noreply.github.com> Date: Sun, 26 Mar 2023 01:46:11 +0800 Subject: [PATCH] Fix memory leak in pools (#8415) --- core/src/mindustry/entities/Damage.java | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/core/src/mindustry/entities/Damage.java b/core/src/mindustry/entities/Damage.java index e7323d395b..fe1ab35290 100644 --- a/core/src/mindustry/entities/Damage.java +++ b/core/src/mindustry/entities/Damage.java @@ -618,7 +618,7 @@ public class Damage{ return Math.max(damage - armor, minArmorDamage * damage); } - public static class Collided{ + public static class Collided implements Pool.Poolable{ public float x, y; public Teamc target; @@ -628,5 +628,10 @@ public class Damage{ this.target = target; return this; } + + @Override + public void reset(){ + target = null; + } } }