diff options
author | daneren2005 <daneren2005@gmail.com> | 2013-11-26 09:08:15 -0800 |
---|---|---|
committer | daneren2005 <daneren2005@gmail.com> | 2013-11-26 09:08:15 -0800 |
commit | 6b4b353276665c8287cd054b1f2e0a89480c19a7 (patch) | |
tree | 8080749bdc7f978098964787126b06c43d769e4d | |
parent | 433bf25da269aa95646e4479b7716687e95e802e (diff) | |
download | dsub-6b4b353276665c8287cd054b1f2e0a89480c19a7.tar.gz dsub-6b4b353276665c8287cd054b1f2e0a89480c19a7.tar.bz2 dsub-6b4b353276665c8287cd054b1f2e0a89480c19a7.zip |
Put oldBitmaps back in if it's not recycled
-rw-r--r-- | src/github/daneren2005/dsub/util/ImageLoader.java | 8 |
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); + } } } }; |