[SCM] WebKit Debian packaging branch, debian/unstable, updated. debian/1.1.15-1-40151-g37bb677
darin
darin at 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Sat Sep 26 07:39:15 UTC 2009
The following commit has been merged in the debian/unstable branch:
commit 4bedbdd431efeeeb2a874ae7e7ad3e54697fa70d
Author: darin <darin at 268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date: Tue Apr 29 19:44:17 2003 +0000
Reviewed by John.
- fixed 3234633 -- page with moderately deep tag nesting causes crash when closed (www.4strokenationals.com)
* khtml/xml/dom_nodeimpl.cpp: (NodeBaseImpl::~NodeBaseImpl): Avoid recursion by using a global
list of child nodes to destroy and only doing the actual destruction at the top level.
git-svn-id: http://svn.webkit.org/repository/webkit/trunk@4209 268f45cc-cd09-0410-ab3c-d52691b4dbfc
diff --git a/WebCore/ChangeLog-2003-10-25 b/WebCore/ChangeLog-2003-10-25
index 04d7884..264b967 100644
--- a/WebCore/ChangeLog-2003-10-25
+++ b/WebCore/ChangeLog-2003-10-25
@@ -1,5 +1,14 @@
2003-04-29 Darin Adler <darin at apple.com>
+ Reviewed by John.
+
+ - fixed 3234633 -- page with moderately deep tag nesting causes crash when closed (www.4strokenationals.com)
+
+ * khtml/xml/dom_nodeimpl.cpp: (NodeBaseImpl::~NodeBaseImpl): Avoid recursion by using a global
+ list of child nodes to destroy and only doing the actual destruction at the top level.
+
+2003-04-29 Darin Adler <darin at apple.com>
+
Mostly reviewed by Ken, some bits reviewed by John.
- fixed 3188781 -- eliminate globally initialized objects from WebCore
diff --git a/WebCore/ChangeLog-2005-08-23 b/WebCore/ChangeLog-2005-08-23
index 04d7884..264b967 100644
--- a/WebCore/ChangeLog-2005-08-23
+++ b/WebCore/ChangeLog-2005-08-23
@@ -1,5 +1,14 @@
2003-04-29 Darin Adler <darin at apple.com>
+ Reviewed by John.
+
+ - fixed 3234633 -- page with moderately deep tag nesting causes crash when closed (www.4strokenationals.com)
+
+ * khtml/xml/dom_nodeimpl.cpp: (NodeBaseImpl::~NodeBaseImpl): Avoid recursion by using a global
+ list of child nodes to destroy and only doing the actual destruction at the top level.
+
+2003-04-29 Darin Adler <darin at apple.com>
+
Mostly reviewed by Ken, some bits reviewed by John.
- fixed 3188781 -- eliminate globally initialized objects from WebCore
diff --git a/WebCore/khtml/xml/dom_nodeimpl.cpp b/WebCore/khtml/xml/dom_nodeimpl.cpp
index 3caa0f2..a3a815c 100644
--- a/WebCore/khtml/xml/dom_nodeimpl.cpp
+++ b/WebCore/khtml/xml/dom_nodeimpl.cpp
@@ -1064,7 +1064,18 @@ NodeBaseImpl::NodeBaseImpl(DocumentPtr *doc)
NodeBaseImpl::~NodeBaseImpl()
{
//kdDebug( 6020 ) << "NodeBaseImpl destructor" << endl;
- // we have to tell all children, that the parent has died...
+
+ // Avoid deep recursion when destroying the node tree.
+ static bool alreadyInsideDestructor;
+ bool topLevel = !alreadyInsideDestructor;
+ if (topLevel)
+ alreadyInsideDestructor = true;
+
+ // List of nodes to be deleted.
+ static NodeImpl *head;
+ static NodeImpl *tail;
+
+ // We have to tell all children that their parent has died.
NodeImpl *n;
NodeImpl *next;
@@ -1073,8 +1084,32 @@ NodeBaseImpl::~NodeBaseImpl()
n->setPreviousSibling(0);
n->setNextSibling(0);
n->setParent(0);
- if ( !n->refCount() )
+
+ if ( !n->refCount() ) {
+ // Add the node to the list of nodes to be deleted.
+ // Reuse the nextSibling pointer for this purpose.
+ if (tail)
+ tail->setNextSibling(n);
+ else
+ head = n;
+ tail = n;
+ }
+ }
+
+ // Only for the top level call, do the actual deleting.
+ if (topLevel) {
+ while ((n = head) != 0) {
+ next = n->nextSibling();
+ n->setNextSibling(0);
+
+ head = next;
+ if (next == 0)
+ tail = 0;
+
delete n;
+ }
+
+ alreadyInsideDestructor = false;
}
}
--
WebKit Debian packaging
More information about the Pkg-webkit-commits
mailing list