The code on the CacheDispatcher is as below. And focus on that release previous request object to avoid leaking request object when mQueue is drained. I do not know why. Can anyone tell me the reason? Thanks in advance.
java
Request<?> request;
while (true) {
// release previous request object to avoid leaking request object when mQueue is drained.
request = null;
try {
// Take a request from the queue.
request = mCacheQueue.take();
} catch (InterruptedException e) {
// We may have been interrupted because it was time to quit.
if (mQuit) {
return;
}
continue;
}
}