Reviewed by Darin.
authorggaren <ggaren@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 26 Sep 2006 17:12:45 +0000 (17:12 +0000)
committerggaren <ggaren@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 26 Sep 2006 17:12:45 +0000 (17:12 +0000)
        Temporary work-around for frame lifetime issue.

        * page/Frame.cpp:
        (WebCore::Frame::clear):
        (WebCore::Frame::disconnectOwnerElement):

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

WebCore/ChangeLog
WebCore/page/Frame.cpp

index 29a7b96d40166701560faa0ea5d3c13f047524a0..bfe70da006ca8bd6908b5c366a7ea3ff2f0a0280 100644 (file)
@@ -1,3 +1,13 @@
+2006-09-26  Geoffrey Garen <ggaren@apple.com>
+
+        Reviewed by Darin.
+        
+        Temporary work-around for frame lifetime issue.
+
+        * page/Frame.cpp:
+        (WebCore::Frame::clear):
+        (WebCore::Frame::disconnectOwnerElement):
+
 2006-09-26  Sam Weinig  <sam.weinig@gmail.com>
 
         Reviewed by Tim H.
index 7b4cc35fba535c765c5ff2e2a881e8e6471c9953..28ab0a08aa4049be9b5f9eddac0ea227a72aeb55 100644 (file)
@@ -467,6 +467,14 @@ void Frame::clear(bool clearWindowProperties)
   d->m_bCleared = true;
   d->m_mousePressNode = 0;
 
+#if !PLATFORM(MAC)
+  // FIXME: This is a temporary hack to work around a mismatch between WebCore and WebKit
+  // regarding frame lifetime. The proper solution is to move all frame management
+  // into WebCore, so frames can work the same way on all platforms.
+  for (Frame* descendant = tree()->firstChild(); descendant; descendant = descendant->tree()->traverseNext())
+      descendant->disconnectOwnerElement();
+#endif
+
   if (d->m_doc) {
     d->m_doc->cancelParsing();
     d->m_doc->detach();
@@ -3639,7 +3647,7 @@ void Frame::started()
 
 void Frame::disconnectOwnerElement()
 {
-    if (d->m_ownerElement)
+    if (d->m_ownerElement && d->m_page)
         d->m_page->decrementFrameCount();
         
     d->m_ownerElement = 0;