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 81d29cc4b4
commit cb5ca86168

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);