X-Git-Url: http://git.webkit.org/?p=WebKit-https.git;a=blobdiff_plain;f=Tools%2FWebKitTestRunner%2FInjectedBundle%2FInjectedBundle.cpp;h=5f1c220f481caa5662d70207ebcfa3d6aaebf455;hp=72a057fd02c43f8bc99c7f78a58d26e53e84e74b;hb=3926b1181dea0fd6c8be9ff5ca46608e8083e2f3;hpb=6ada91bed5a419486e3ef124974605a8527431b2 diff --git a/Tools/WebKitTestRunner/InjectedBundle/InjectedBundle.cpp b/Tools/WebKitTestRunner/InjectedBundle/InjectedBundle.cpp index 72a057f..5f1c220 100644 --- a/Tools/WebKitTestRunner/InjectedBundle/InjectedBundle.cpp +++ b/Tools/WebKitTestRunner/InjectedBundle/InjectedBundle.cpp @@ -189,6 +189,9 @@ static void postGCTask(void* context) void InjectedBundle::reportLiveDocuments(WKBundlePageRef page) { + // Release memory again, after the GC and timer fire. This is necessary to clear entries from CachedResourceLoader's m_documentResources in some scenarios. + WKBundleReleaseMemory(m_bundle); + const bool excludeDocumentsInPageGroup = true; auto documentURLs = adoptWK(WKBundleGetLiveDocumentURLs(m_bundle, m_pageGroup, excludeDocumentsInPageGroup)); auto ackMessageName = adoptWK(WKStringCreateWithUTF8CString("LiveDocuments")); @@ -274,7 +277,7 @@ void InjectedBundle::didReceiveMessageToPage(WKBundlePageRef page, WKStringRef m WKBundleReleaseMemory(m_bundle); WKRetain(page); // Balanced by the release in postGCTask. - WKBundlePagePostTask(page, postGCTask, (void*)page); + WKBundlePageCallAfterTasksAndTimers(page, postGCTask, (void*)page); return; }