Many modern media control tests leak documents in testing
[WebKit-https.git] / Source / WebCore / page / MemoryRelease.cpp
index 57778bf..4a67fe0 100644 (file)
@@ -28,6 +28,7 @@
 
 #include "CSSFontSelector.h"
 #include "CSSValuePool.h"
+#include "CachedResourceLoader.h"
 #include "Chrome.h"
 #include "ChromeClient.h"
 #include "CommonVM.h"
@@ -88,6 +89,7 @@ static void releaseCriticalMemory(Synchronous synchronous)
     for (auto& document : copyToVectorOf<RefPtr<Document>>(Document::allDocuments())) {
         document->styleScope().releaseMemory();
         document->fontSelector().emptyCaches();
+        document->cachedResourceLoader().garbageCollectDocumentResources();
     }
 
     GCController::singleton().deleteAllCode(JSC::DeleteAllCodeIfNotCollecting);