From d6feb46dacd76ae0a4cc97f24e1c0a07515e6055 Mon Sep 17 00:00:00 2001 From: John Reck Date: Fri, 1 Mar 2013 10:23:42 -0800 Subject: Fix race condition Change-Id: I6cf9207d067d4c0c3c4271d6ce6f44b213d7296b --- src/com/android/photos/data/GalleryBitmapPool.java | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'src/com/android') diff --git a/src/com/android/photos/data/GalleryBitmapPool.java b/src/com/android/photos/data/GalleryBitmapPool.java index cddc160fd..4c3279f73 100644 --- a/src/com/android/photos/data/GalleryBitmapPool.java +++ b/src/com/android/photos/data/GalleryBitmapPool.java @@ -46,11 +46,9 @@ public class GalleryBitmapPool { mCapacityBytes = capacityBytes; } - private static GalleryBitmapPool sInstance; + private static GalleryBitmapPool sInstance = new GalleryBitmapPool(CAPACITY_BYTES); + public static GalleryBitmapPool getInstance() { - if (sInstance == null) { - sInstance = new GalleryBitmapPool(CAPACITY_BYTES); - } return sInstance; } -- cgit v1.2.3