diff options
author | John Reck <jreck@google.com> | 2013-03-01 10:23:42 -0800 |
---|---|---|
committer | John Reck <jreck@google.com> | 2013-03-01 10:23:42 -0800 |
commit | d6feb46dacd76ae0a4cc97f24e1c0a07515e6055 (patch) | |
tree | 798f8faeec1e117bb238c43091479638562d4fcd | |
parent | facd6eec5e6e5ff63725d00a791662c462c111c4 (diff) | |
download | android_packages_apps_Snap-d6feb46dacd76ae0a4cc97f24e1c0a07515e6055.tar.gz android_packages_apps_Snap-d6feb46dacd76ae0a4cc97f24e1c0a07515e6055.tar.bz2 android_packages_apps_Snap-d6feb46dacd76ae0a4cc97f24e1c0a07515e6055.zip |
Fix race condition
Change-Id: I6cf9207d067d4c0c3c4271d6ce6f44b213d7296b
-rw-r--r-- | src/com/android/photos/data/GalleryBitmapPool.java | 6 |
1 files 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; } |