mirror of
https://github.com/sudoxnym/habitica-android.git
synced 2026-05-18 03:39:00 +00:00
Ensure layers is reset when generating new images
Otherwise we keep adding layers infinitely (even if we only use a handful of them). Worst-case scenario, this leads to memory leaks with Bitmaps retained at the end of the layer list.
This commit is contained in:
parent
d2275b7a77
commit
b3b59cbb4d
1 changed files with 1 additions and 0 deletions
|
|
@ -175,6 +175,7 @@ public class UserPicture {
|
|||
private void generateImage(List<String> layerNames) {
|
||||
Integer layerNumber = 0;
|
||||
this.numOfTasks.set(layerNames.size());
|
||||
layers.clear();
|
||||
for (String layer : layerNames) {
|
||||
layers.add(null);
|
||||
SpriteTarget target = new SpriteTarget(layerNumber, layer);
|
||||
|
|
|
|||
Loading…
Reference in a new issue