| Index: Source/core/dom/Document.cpp
|
| diff --git a/Source/core/dom/Document.cpp b/Source/core/dom/Document.cpp
|
| index 54ab2be7d7b9cd06c5957495d4213e434870a6bb..d5a7cf9e6b63fb2e6295b51dd464960e149e1cf8 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();
|
| }
|
|
|
| @@ -2204,7 +2204,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,
|
| @@ -2233,6 +2233,8 @@ void Document::detach(const AttachContext& context)
|
| // created by DOMImplementation::createDocument().
|
| DocumentLifecycleNotifier::notifyContextDestroyed();
|
| ExecutionContext::notifyContextDestroyed();
|
| +
|
| + m_fetcher.clear();
|
| }
|
|
|
| void Document::removeAllEventListeners()
|
| @@ -4635,7 +4637,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>*)
|
|
|