Index: Source/core/dom/Document.cpp |
diff --git a/Source/core/dom/Document.cpp b/Source/core/dom/Document.cpp |
index aedb82cfd8d8e76b27f94995805b7fa7464715f8..e96a85bd55620ebf358c09ed5da5e61253deed3c 100644 |
--- a/Source/core/dom/Document.cpp |
+++ b/Source/core/dom/Document.cpp |
@@ -821,7 +821,7 @@ void Document::setImportsController(HTMLImportsController* controller) |
{ |
ASSERT(!m_importsController || !controller); |
m_importsController = controller; |
- if (!m_importsController && !loader()) |
+ if (!m_importsController && !loader() && m_fetcher) |
m_fetcher->clearContext(); |
} |
@@ -2205,7 +2205,7 @@ void Document::detach(const AttachContext& context) |
// to the DocumentLoader when possible also prevents prematurely clearing |
// the context in the case where multiple Documents end up associated with |
// a single DocumentLoader (e.g., navigating to a javascript: url). |
- if (!loader()) |
+ if (!loader() && m_fetcher) |
m_fetcher->clearContext(); |
// If this document is the master for an HTMLImportsController, sever that |
// relationship. This ensures that we don't leave import loads in flight, |
@@ -2234,6 +2234,8 @@ void Document::detach(const AttachContext& context) |
// created by DOMImplementation::createDocument(). |
DocumentLifecycleNotifier::notifyContextDestroyed(); |
ExecutionContext::notifyContextDestroyed(); |
+ |
+ m_fetcher.clear(); |
} |
void Document::removeAllEventListeners() |
@@ -4636,7 +4638,8 @@ void Document::finishedParsing() |
m_elementDataCacheClearTimer.startOneShot(10, FROM_HERE); |
// Parser should have picked up all preloads by now |
- m_fetcher->clearPreloads(); |
+ if (m_fetcher) |
+ m_fetcher->clearPreloads(); |
} |
void Document::elementDataCacheClearTimerFired(Timer<Document>*) |