From: John Reck Date: Fri, 1 Mar 2013 18:23:42 +0000 (-0800) Subject: Fix race condition X-Git-Tag: android-x86-6.0-r3~68^2~28^2~213^2~19^2^2^2^2^2^2^2^2^2^2^2^2^2^2^2^2^2^2^2^2^2^2^2^2~428^2~2^2~201^2~273 X-Git-Url: http://git.osdn.net/view?a=commitdiff_plain;h=08c0f250;p=android-x86%2Fpackages-apps-Camera2.git Fix race condition Change-Id: I6cf9207d067d4c0c3c4271d6ce6f44b213d7296b --- 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; }