aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/github/daneren2005/dsub/util/ImageLoader.java8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/github/daneren2005/dsub/util/ImageLoader.java b/src/github/daneren2005/dsub/util/ImageLoader.java
index 331bc629..b68a7b07 100644
--- a/src/github/daneren2005/dsub/util/ImageLoader.java
+++ b/src/github/daneren2005/dsub/util/ImageLoader.java
@@ -74,8 +74,12 @@ public class ImageLoader implements Runnable {
@Override
protected void entryRemoved(boolean evicted, String key, Bitmap oldBitmap, Bitmap newBitmap) {
- if(evicted && oldBitmap != nowPlaying) {
- oldBitmap.recycle();
+ if(evicted) {
+ if(oldBitmap != nowPlaying) {
+ oldBitmap.recycle();
+ } else {
+ cache.put(key, oldBitmap);
+ }
}
}
};