Skip to content

Commit 9ff36ae

Browse files
committed
v2.0.2: fixed runaway memory usage with new action indicator
1 parent 99195f0 commit 9ff36ae

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/ui/ActionIndicator.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,10 +96,12 @@ public synchronized void update() {
9696

9797
if (needsRefresh){
9898
if (primaryVis != null) {
99+
primaryVis.destroy();
99100
primaryVis.killAndErase();
100101
primaryVis = null;
101102
}
102103
if (secondVis != null){
104+
secondVis.destroy();
103105
secondVis.killAndErase();
104106
secondVis = null;
105107
}
@@ -112,11 +114,11 @@ public synchronized void update() {
112114
add(secondVis);
113115
}
114116

115-
needsRefresh = true;
116117
setColor(action.indicatorColor());
117118
}
118119

119120
layout();
121+
needsRefresh = false;
120122
}
121123

122124
if (!Dungeon.hero.ready){

0 commit comments

Comments
 (0)