From c4130b7caa3ac11d4c1b9fdebf8459270a6b3ff1 Mon Sep 17 00:00:00 2001 From: Scott Jackson Date: Sun, 13 Jan 2013 12:40:48 -0800 Subject: Make sure to immediately recycle non-scaled bitmap --- subsonic-android/src/github/daneren2005/dsub/util/FileUtil.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/subsonic-android/src/github/daneren2005/dsub/util/FileUtil.java b/subsonic-android/src/github/daneren2005/dsub/util/FileUtil.java index 421226cf..d210920b 100644 --- a/subsonic-android/src/github/daneren2005/dsub/util/FileUtil.java +++ b/subsonic-android/src/github/daneren2005/dsub/util/FileUtil.java @@ -102,7 +102,9 @@ public class FileUtil { File albumArtFile = getAlbumArtFile(context, entry); if (albumArtFile.exists()) { Bitmap bitmap = BitmapFactory.decodeFile(albumArtFile.getPath()); - return bitmap == null ? null : Bitmap.createScaledBitmap(bitmap, size, size, true); + Bitmap scaledBitmap = (bitmap == null) ? null : Bitmap.createScaledBitmap(bitmap, size, size, true); + bitmap.recycle(); + return scaledBitmap; } return null; } -- cgit v1.2.3