From 2efe5e97506c0e8ffc17f3cae2919b4be6091989 Mon Sep 17 00:00:00 2001 From: Feng Qian Date: Fri, 10 Jul 2009 16:13:29 -0700 Subject: 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. --- V8Binding/binding/v8_proxy.cpp | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) (limited to 'V8Binding/binding/v8_proxy.cpp') 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(); -- cgit v1.1