2011-04-18 Geoffrey Garen <ggaren@apple.com>
authorggaren@apple.com <ggaren@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 18 Apr 2011 22:53:46 +0000 (22:53 +0000)
committerggaren@apple.com <ggaren@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 18 Apr 2011 22:53:46 +0000 (22:53 +0000)
        Discovered and rubber-stamped by Stephanie Lewis.

        Restored some code I accidentally deleted in <http://trac.webkit.org/changeset/83990>

        * bindings/js/DOMWrapperWorld.cpp:
        (WebCore::DOMWrapperWorld::~DOMWrapperWorld):
        (WebCore::DOMWrapperWorld::clearWrappers): Do clear / destroy all our
        window shells when clearing / destroying ourselves. r83990 removed this
        behavior for documents since there are no per-document maps anymore,
        but removing this behavior for window shells too was a typo.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@84198 268f45cc-cd09-0410-ab3c-d52691b4dbfc

Source/WebCore/ChangeLog
Source/WebCore/bindings/js/DOMWrapperWorld.cpp

index 4615b55..2fd1bfa 100644 (file)
@@ -1,5 +1,18 @@
 2011-04-18  Geoffrey Garen  <ggaren@apple.com>
 
+        Discovered and rubber-stamped by Stephanie Lewis.
+
+        Restored some code I accidentally deleted in <http://trac.webkit.org/changeset/83990>
+
+        * bindings/js/DOMWrapperWorld.cpp:
+        (WebCore::DOMWrapperWorld::~DOMWrapperWorld):
+        (WebCore::DOMWrapperWorld::clearWrappers): Do clear / destroy all our
+        window shells when clearing / destroying ourselves. r83990 removed this
+        behavior for documents since there are no per-document maps anymore,
+        but removing this behavior for window shells too was a typo.
+
+2011-04-18  Geoffrey Garen  <ggaren@apple.com>
+
         Reviewed by Oliver Hunt.
 
         Made DOM handle ownership customizable, and customized it for Nodes and NamedAttrMaps
index b52e2ff..b7c6d1e 100644 (file)
@@ -50,12 +50,20 @@ DOMWrapperWorld::~DOMWrapperWorld()
     JSGlobalData::ClientData* clientData = m_globalData->clientData;
     ASSERT(clientData);
     static_cast<WebCoreJSClientData*>(clientData)->forgetWorld(this);
+
+    // These items are created lazily.
+    while (!m_scriptControllersWithWindowShells.isEmpty())
+        (*m_scriptControllersWithWindowShells.begin())->destroyWindowShell(this);
 }
 
 void DOMWrapperWorld::clearWrappers()
 {
     m_wrappers.clear();
     m_stringCache.clear();
+
+    // These items are created lazily.
+    while (!m_scriptControllersWithWindowShells.isEmpty())
+        (*m_scriptControllersWithWindowShells.begin())->destroyWindowShell(this);
 }
 
 DOMWrapperWorld* normalWorld(JSC::JSGlobalData& globalData)