Index: third_party/WebKit/Source/core/dom/ScriptRunner.cpp |
diff --git a/third_party/WebKit/Source/core/dom/ScriptRunner.cpp b/third_party/WebKit/Source/core/dom/ScriptRunner.cpp |
index 748809724c54905f9089c9175b69ee405c8486d2..c4ef3e7f6636ec7e8751c52c151262bb7e95d5ff 100644 |
--- a/third_party/WebKit/Source/core/dom/ScriptRunner.cpp |
+++ b/third_party/WebKit/Source/core/dom/ScriptRunner.cpp |
@@ -48,6 +48,13 @@ ScriptRunner::ScriptRunner(Document* document) |
ScriptRunner::~ScriptRunner() |
{ |
#if !ENABLE(OILPAN) |
+ dispose(); |
+#endif |
+} |
+ |
+#if !ENABLE(OILPAN) |
+void ScriptRunner::dispose() |
+{ |
// Make sure that ScriptLoaders don't keep their PendingScripts alive. |
for (ScriptLoader* scriptLoader : m_scriptsToExecuteInOrder) |
scriptLoader->detach(); |
@@ -55,8 +62,12 @@ ScriptRunner::~ScriptRunner() |
scriptLoader->detach(); |
for (ScriptLoader* scriptLoader : m_pendingAsyncScripts) |
scriptLoader->detach(); |
-#endif |
+ |
+ m_scriptsToExecuteInOrder.clear(); |
+ m_scriptsToExecuteSoon.clear(); |
+ m_pendingAsyncScripts.clear(); |
} |
+#endif |
void ScriptRunner::addPendingAsyncScript(ScriptLoader* scriptLoader) |
{ |