Index: Source/core/fetch/MemoryCache.cpp |
diff --git a/Source/core/fetch/MemoryCache.cpp b/Source/core/fetch/MemoryCache.cpp |
index 0f79f552f8d1941917dc39eb41e500d8746479ab..7e3c36bd0c9aab45fef9dff0b45d17db401a7252 100644 |
--- a/Source/core/fetch/MemoryCache.cpp |
+++ b/Source/core/fetch/MemoryCache.cpp |
@@ -85,6 +85,13 @@ void MemoryCacheEntry::trace(Visitor* visitor) |
visitor->trace(m_nextInAllResourcesList); |
} |
+#if ENABLE(OILPAN) |
+void MemoryCacheEntry::dispose() |
+{ |
+ m_resource.clear(); |
+} |
+#endif |
+ |
void MemoryCacheLRUList::trace(Visitor* visitor) |
{ |
visitor->trace(m_head); |
@@ -372,11 +379,17 @@ bool MemoryCache::evict(MemoryCacheEntry* entry) |
ResourceMap::iterator it = m_resources.find(resource->url()); |
ASSERT(it != m_resources.end()); |
-#if !ENABLE(OILPAN) |
+#if ENABLE(OILPAN) |
+ MemoryCacheEntry* entryPtr = it->value; |
+#else |
OwnPtr<MemoryCacheEntry> entryPtr; |
entryPtr.swap(it->value); |
#endif |
m_resources.remove(it); |
+#if ENABLE(OILPAN) |
+ if (entryPtr) |
+ entryPtr->dispose(); |
+#endif |
return canDelete; |
} |