Skip to content

Commit

Permalink
Fix memory leak in utiLITI editor when moving around light sources
Browse files Browse the repository at this point in the history
Implemented an editor specific fix that does not cache ambient light images for when the application's name is "utiLITI".

Fixes #3
  • Loading branch information
Gurkenlabs committed Apr 18, 2017
1 parent 0d09d17 commit ccb8591
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/de/gurkenlabs/litiengine/graphics/AmbientLight.java
Expand Up @@ -81,7 +81,10 @@ public void createImage() {
g.setComposite(comp);
g.dispose();
this.image = img;
ImageCache.IMAGES.put(cacheKey, img);

if (!Game.getInfo().getName().equals("utiLITI")) {
ImageCache.IMAGES.put(cacheKey, img);
}
}

public int getAlpha() {
Expand Down

1 comment on commit ccb8591

@gurkenlabs
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fixes #4

Please sign in to comment.