2008-05-30 Maciej Stachowiak <mjs@apple.com>
[WebKit.git] / WebCore / bindings / js / JSDOMWindowBase.cpp
index 35ecfa6c70d66eeedbb7fbe14c270b4b5248e98b..d266d0199aef0d3bceadda83dd9f546d7fe6e028 100644 (file)
@@ -202,7 +202,8 @@ void JSDOMWindowBase::updateDocument()
 
 JSDOMWindowBase::~JSDOMWindowBase()
 {
-    d->m_shell->clearFormerWindow(asJSDOMWindow(this));
+    if (m_impl->frame())
+        m_impl->frame()->scriptProxy()->clearFormerWindow(asJSDOMWindow(this));
 
     clearAllTimeouts();