CacheDispatcher 上的代码如下。并专注于释放先前的请求对象,以避免在 mQueue 耗尽时泄漏请求对象。我不知道为什么。谁能告诉我原因?提前致谢。
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;
}
}