From 08c0f25091f20c4d618b5adaa381ed6eedf4695f Mon Sep 17 00:00:00 2001 From: John Reck Date: Fri, 1 Mar 2013 10:23:42 -0800 Subject: [PATCH] Fix race condition Change-Id: I6cf9207d067d4c0c3c4271d6ce6f44b213d7296b --- src/com/android/photos/data/GalleryBitmapPool.java | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) 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; } -- 2.11.0