summaryrefslogtreecommitdiff
path: root/src/com/android/bitmap/DecodeTask.java
diff options
context:
space:
mode:
Diffstat (limited to 'src/com/android/bitmap/DecodeTask.java')
-rw-r--r--src/com/android/bitmap/DecodeTask.java7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/com/android/bitmap/DecodeTask.java b/src/com/android/bitmap/DecodeTask.java
index 0f12bae..77b5982 100644
--- a/src/com/android/bitmap/DecodeTask.java
+++ b/src/com/android/bitmap/DecodeTask.java
@@ -440,8 +440,11 @@ public class DecodeTask extends AsyncTask<Void, Void, ReusableBitmap> {
}
}
- // Put result in cache, regardless of null. The cache will handle null results.
- mCache.put(mKey, result);
+ // Cancellations can't be guaranteed to be correct, so skip the cache
+ if (!isCancelled()) {
+ // Put result in cache, regardless of null. The cache will handle null results.
+ mCache.put(mKey, result);
+ }
if (result != null) {
result.acquireReference();
if (DEBUG) {