[SCM] WebKit Debian packaging branch, debian/unstable, updated. debian/1.1.15-1-40151-g37bb677

mjs mjs at 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Sat Sep 26 06:31:10 UTC 2009


The following commit has been merged in the debian/unstable branch:
commit ef5bb99186ce02a04772d07a0f7a892db1e46913
Author: mjs <mjs at 268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Wed Aug 14 09:02:33 2002 +0000

    	Fixed a JavaScript object leak that was plaguing ign.com and
    	livepage.apple.com, among other things.
    
            * khtml/ecma/kjs_html.cpp:
            (KJS::HTMLDocument::putValue): Create a Value wrapper for a newly allocated
    	DOMNode object that's not used past this function so it gets GC'd properly.
            (KJS::HTMLElement::putValue): Likewise.
    
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@1813 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/WebCore/ChangeLog-2002-12-03 b/WebCore/ChangeLog-2002-12-03
index e181722..af731a1 100644
--- a/WebCore/ChangeLog-2002-12-03
+++ b/WebCore/ChangeLog-2002-12-03
@@ -1,5 +1,15 @@
 2002-08-14  Maciej Stachowiak  <mjs at apple.com>
 
+	Fixed a JavaScript object leak that was plaguing ign.com and
+	livepage.apple.com, among other things.
+	
+        * khtml/ecma/kjs_html.cpp:
+        (KJS::HTMLDocument::putValue): Create a Value wrapper for a newly allocated
+	DOMNode object that's not used past this function so it gets GC'd properly.
+        (KJS::HTMLElement::putValue): Likewise.
+
+2002-08-14  Maciej Stachowiak  <mjs at apple.com>
+
         * khtml/ecma/kjs_window.cpp: Fix to build clean after
 	JavaScriptCore live class changes (this way of handling it is kind
 	of a hack, but kjs is unhappy to have Boolean defined so it can't
diff --git a/WebCore/ChangeLog-2003-10-25 b/WebCore/ChangeLog-2003-10-25
index e181722..af731a1 100644
--- a/WebCore/ChangeLog-2003-10-25
+++ b/WebCore/ChangeLog-2003-10-25
@@ -1,5 +1,15 @@
 2002-08-14  Maciej Stachowiak  <mjs at apple.com>
 
+	Fixed a JavaScript object leak that was plaguing ign.com and
+	livepage.apple.com, among other things.
+	
+        * khtml/ecma/kjs_html.cpp:
+        (KJS::HTMLDocument::putValue): Create a Value wrapper for a newly allocated
+	DOMNode object that's not used past this function so it gets GC'd properly.
+        (KJS::HTMLElement::putValue): Likewise.
+
+2002-08-14  Maciej Stachowiak  <mjs at apple.com>
+
         * khtml/ecma/kjs_window.cpp: Fix to build clean after
 	JavaScriptCore live class changes (this way of handling it is kind
 	of a hack, but kjs is unhappy to have Boolean defined so it can't
diff --git a/WebCore/ChangeLog-2005-08-23 b/WebCore/ChangeLog-2005-08-23
index e181722..af731a1 100644
--- a/WebCore/ChangeLog-2005-08-23
+++ b/WebCore/ChangeLog-2005-08-23
@@ -1,5 +1,15 @@
 2002-08-14  Maciej Stachowiak  <mjs at apple.com>
 
+	Fixed a JavaScript object leak that was plaguing ign.com and
+	livepage.apple.com, among other things.
+	
+        * khtml/ecma/kjs_html.cpp:
+        (KJS::HTMLDocument::putValue): Create a Value wrapper for a newly allocated
+	DOMNode object that's not used past this function so it gets GC'd properly.
+        (KJS::HTMLElement::putValue): Likewise.
+
+2002-08-14  Maciej Stachowiak  <mjs at apple.com>
+
         * khtml/ecma/kjs_window.cpp: Fix to build clean after
 	JavaScriptCore live class changes (this way of handling it is kind
 	of a hack, but kjs is unhappy to have Boolean defined so it can't
diff --git a/WebCore/khtml/ecma/kjs_html.cpp b/WebCore/khtml/ecma/kjs_html.cpp
index 94d8291..da61a32 100644
--- a/WebCore/khtml/ecma/kjs_html.cpp
+++ b/WebCore/khtml/ecma/kjs_html.cpp
@@ -281,7 +281,10 @@ void KJS::HTMLDocument::putValue(ExecState *exec, int token, const Value& value,
     doc.setTitle(value.toString(exec).string());
     break;
   case Body:
-    doc.setBody((new DOMNode(exec, KJS::toNode(value)))->toNode());
+    DOMNode node = new DOMNode(exec, KJS::toNode(value));
+    // This is required to avoid leaking the node.
+    Value nodeValue(node);
+    doc.setBody(()->toNode());
     break;
   case Domain: { // not part of the DOM
     DOM::HTMLDocumentImpl* docimpl = static_cast<DOM::HTMLDocumentImpl*>(doc.handle());
@@ -1945,7 +1948,10 @@ void KJS::HTMLElement::tryPut(ExecState *exec, const UString &propertyName, cons
 void KJS::HTMLElement::putValue(ExecState *exec, int token, const Value& value, int)
 {
   DOM::DOMString str = value.isA(NullType) ? DOM::DOMString() : value.toString(exec).string();
-  DOM::Node n = (new DOMNode(exec, KJS::toNode(value)))->toNode();
+  DOMNode *kjsNode = new DOMNode(exec, KJS::toNode(value));
+  // Need to create a Value wrapper to avoid leaking the KJS::DOMNode
+  Value nodeValue(kjsNode);
+  DOM::Node n = kjsNode->toNode();
   DOM::HTMLElement element = static_cast<DOM::HTMLElement>(node);
 #ifdef KJS_VERBOSE
   kdDebug(6070) << "KJS::HTMLElement::putValue "

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list