Bug 1096913: Remove the simple cache entry when replacing the cache entry. r=mwu

This solves the issue since *mRequest may be different for the replacing entry, causing the simple cache entry never to be removed from NotifyExpired or replaced. And the simple cache to grow indefinitely.
This commit is contained in:
Bas Schouten 2014-11-11 22:09:32 +00:00
parent 93ec577355
commit 50868f204d

View File

@ -250,6 +250,7 @@ CanvasImageCache::NotifyDrawImage(Element* aImage,
// We are overwriting an existing entry.
gImageCache->mTotal -= entry->mData->SizeInBytes();
gImageCache->RemoveObject(entry->mData);
gImageCache->mSimpleCache.RemoveEntry(*entry->mData->mRequest);
}
gImageCache->AddObject(entry->mData);