diff --git a/FileManager/src/org/openintents/filemanager/ThumbnailLoader.java b/FileManager/src/org/openintents/filemanager/ThumbnailLoader.java index 97b28b3d..b2c8127d 100644 --- a/FileManager/src/org/openintents/filemanager/ThumbnailLoader.java +++ b/FileManager/src/org/openintents/filemanager/ThumbnailLoader.java @@ -29,6 +29,7 @@ import java.io.File; import java.lang.ref.SoftReference; import java.util.ArrayList; +import java.util.Collections; import java.util.LinkedHashMap; import java.util.List; import java.util.concurrent.ConcurrentHashMap; @@ -60,7 +61,7 @@ public class ThumbnailLoader { // This gets cleared by the Garbage Collector everytime we get low on memory. private ConcurrentHashMap> mSoftBitmapCache; private LinkedHashMap mHardBitmapCache; - private ArrayList mBlacklist; + private List mBlacklist; /** * Used for loading and decoding thumbnails from files. @@ -82,7 +83,7 @@ public void run() { purgeHandler = new Handler(); mExecutor = new PausableThreadPoolExecutor(POOL_SIZE); - mBlacklist = new ArrayList<>(); + mBlacklist = Collections.synchronizedList(new ArrayList()); mSoftBitmapCache = new ConcurrentHashMap<>(MAX_CACHE_CAPACITY / 2); mHardBitmapCache = new LinkedHashMap(MAX_CACHE_CAPACITY / 2, 0.75f, true) { @@ -166,8 +167,6 @@ public void stopPurgeTimer() { /** * Purges the cache every (DELAY_BEFORE_PURGE) milliseconds. - * - * @see DELAY_BEFORE_PURGE */ private void resetPurgeTimer() { purgeHandler.removeCallbacks(purger); diff --git a/FileManager/src/org/openintents/filemanager/util/CopyHelper.java b/FileManager/src/org/openintents/filemanager/util/CopyHelper.java index bf42819a..c82a7438 100644 --- a/FileManager/src/org/openintents/filemanager/util/CopyHelper.java +++ b/FileManager/src/org/openintents/filemanager/util/CopyHelper.java @@ -134,7 +134,9 @@ private boolean copyFile(File oldFile, File newFile) { // ignore } try { - output.close(); + if (output != null) { + output.close(); + } } catch (IOException e) { // ignore }