diff options
author | Scott Jackson <daneren2005@gmail.com> | 2015-12-17 17:21:43 -0800 |
---|---|---|
committer | Scott Jackson <daneren2005@gmail.com> | 2015-12-17 17:21:43 -0800 |
commit | 2aaca47d4ae2cfc43eafca8f3dd6671a04b30965 (patch) | |
tree | 6c42919ce2c3211ad83c0e8f3339072e1337dcb5 /app | |
parent | feb544c6bda05ea0bbfe6f53ddf14188d1e30881 (diff) | |
download | dsub-2aaca47d4ae2cfc43eafca8f3dd6671a04b30965.tar.gz dsub-2aaca47d4ae2cfc43eafca8f3dd6671a04b30965.tar.bz2 dsub-2aaca47d4ae2cfc43eafca8f3dd6671a04b30965.zip |
Fix infinite recursion of removing then re-putting same bitmap on stack
Diffstat (limited to 'app')
-rw-r--r-- | app/src/main/java/github/daneren2005/dsub/util/ImageLoader.java | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/app/src/main/java/github/daneren2005/dsub/util/ImageLoader.java b/app/src/main/java/github/daneren2005/dsub/util/ImageLoader.java index 5da66023..85844360 100644 --- a/app/src/main/java/github/daneren2005/dsub/util/ImageLoader.java +++ b/app/src/main/java/github/daneren2005/dsub/util/ImageLoader.java @@ -38,6 +38,9 @@ import android.support.v4.util.LruCache; import android.view.View; import android.widget.ImageView; import android.widget.TextView; + +import java.lang.ref.WeakReference; + import github.daneren2005.dsub.R; import github.daneren2005.dsub.domain.ArtistInfo; import github.daneren2005.dsub.domain.MusicDirectory; @@ -96,7 +99,7 @@ public class ImageLoader { if(evicted) { if((oldBitmap != nowPlaying && oldBitmap != nowPlayingSmall) || clearingCache) { oldBitmap.recycle(); - } else { + } else if(oldBitmap != newBitmap) { cache.put(key, oldBitmap); } } |