summaryrefslogtreecommitdiffstats
path: root/V8Binding
diff options
context:
space:
mode:
authorFeng Qian <fqian@google.com>2009-07-10 16:13:29 -0700
committerFeng Qian <fqian@google.com>2009-07-10 16:13:29 -0700
commit2efe5e97506c0e8ffc17f3cae2919b4be6091989 (patch)
tree87ee38cdea2b4438d312d8647b4df96e45e8b19e /V8Binding
parent0ae3dd0a914cf2524cf988b9cdb9cfbcc4fda3a2 (diff)
downloadexternal_webkit-2efe5e97506c0e8ffc17f3cae2919b4be6091989.zip
external_webkit-2efe5e97506c0e8ffc17f3cae2919b4be6091989.tar.gz
external_webkit-2efe5e97506c0e8ffc17f3cae2919b4be6091989.tar.bz2
Fix a memory leak caused by the binding code.
Old code reinitialize a context when a frame loading a new page, even when the page does not have JavaScript. It also initializes an empty context when before an iframe is destroyed. A fix is made to Chromium project (not it is in WebKit), our next merge should pick up this fix.
Diffstat (limited to 'V8Binding')
-rw-r--r--V8Binding/binding/v8_proxy.cpp8
1 files changed, 1 insertions, 7 deletions
diff --git a/V8Binding/binding/v8_proxy.cpp b/V8Binding/binding/v8_proxy.cpp
index 2d5ee4c..c0de3c6 100644
--- a/V8Binding/binding/v8_proxy.cpp
+++ b/V8Binding/binding/v8_proxy.cpp
@@ -1966,10 +1966,6 @@ void V8Proxy::clearForNavigation()
m_context->DetachGlobal();
DisposeContextHandles();
-
- // Reinitialize the context so the global object points to
- // the new DOM window.
- InitContextIfNeeded();
}
}
@@ -2015,10 +2011,8 @@ void V8Proxy::updateDocument()
if (!m_frame->document())
return;
- if (m_global.IsEmpty()) {
- ASSERT(m_context.IsEmpty());
+ if (m_context.IsEmpty())
return;
- }
// We have a new document and we need to update the cache.
UpdateDocumentWrapperCache();