diff options
author | Anonymous <no-reply@google.com> | 2017-10-09 10:53:24 -0700 |
---|---|---|
committer | Jeff Davidson <jpd@google.com> | 2017-10-11 12:28:08 -0700 |
commit | 82e4a43fe78d4f665985b4e4726ff2baee449fe8 (patch) | |
tree | 19e615b27d9cb80945f86cadc0a7ccca09cc1dee /src/main/java/com/android/volley/ExecutorDelivery.java | |
parent | 2021ca6a6c3fa80646220cb97746f0b1cd3ae103 (diff) | |
download | volley-82e4a43fe78d4f665985b4e4726ff2baee449fe8.tar.gz |
Import of Volley from GitHub to AOSP.
- 95f64de9bfa2ee44d6cf93a6dc4b980e5ec56f6a Fix leak of callbacks on canceled requests. by Jeff Davidson <jpd236@cornell.edu>
GitOrigin-RevId: 95f64de9bfa2ee44d6cf93a6dc4b980e5ec56f6a
Change-Id: I9537a9937f9c0e7078dfa8f8fdfcd8deb36417a7
Diffstat (limited to 'src/main/java/com/android/volley/ExecutorDelivery.java')
-rw-r--r-- | src/main/java/com/android/volley/ExecutorDelivery.java | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/src/main/java/com/android/volley/ExecutorDelivery.java b/src/main/java/com/android/volley/ExecutorDelivery.java index 1babfcd..f36fb75 100644 --- a/src/main/java/com/android/volley/ExecutorDelivery.java +++ b/src/main/java/com/android/volley/ExecutorDelivery.java @@ -88,6 +88,13 @@ public class ExecutorDelivery implements ResponseDelivery { @SuppressWarnings("unchecked") @Override public void run() { + // NOTE: If cancel() is called off the thread that we're currently running in (by + // default, the main thread), we cannot guarantee that deliverResponse()/deliverError() + // won't be called, since it may be canceled after we check isCanceled() but before we + // deliver the response. Apps concerned about this guarantee must either call cancel() + // from the same thread or implement their own guarantee about not invoking their + // listener after cancel() has been called. + // If this request has canceled, finish it and don't deliver. if (mRequest.isCanceled()) { mRequest.finish("canceled-at-delivery"); |