mirror of
https://repo.dactyloidae.xyz/Dactyloidae/UXP.git
synced 2026-09-08 00:38:39 +09:00
Issue #2928 - Re-order imgLoader::RemoveFromCache
Remove from tracker first before removing from cache, and if the cache queue is dirty, refresh it (causes a re-heap) before manipulating further.
This commit is contained in:
parent
f7820b0ab5
commit
7332833ecc
1 changed files with 6 additions and 3 deletions
|
|
@ -1944,17 +1944,20 @@ imgLoader::RemoveFromCache(imgCacheEntry* entry)
|
|||
"imgLoader::RemoveFromCache", "entry's uri",
|
||||
key.Spec());
|
||||
|
||||
cache.Remove(key);
|
||||
|
||||
if (entry->HasNoProxies()) {
|
||||
LOG_STATIC_FUNC(gImgLog,
|
||||
"imgLoader::RemoveFromCache removing from tracker");
|
||||
if (mCacheTracker && queue.GetSize() > 0) {
|
||||
if (queue.IsDirty()) {
|
||||
queue.Refresh();
|
||||
}
|
||||
if (mCacheTracker) {
|
||||
mCacheTracker->RemoveObject(entry);
|
||||
}
|
||||
queue.Remove(entry);
|
||||
}
|
||||
|
||||
cache.Remove(key);
|
||||
|
||||
entry->SetEvicted(true);
|
||||
request->SetIsInCache(false);
|
||||
AddToUncachedImages(request);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue