Title: [94894] trunk/Source/WebCore
Revision
94894
Author
jchaffr...@webkit.org
Date
2011-09-09 18:16:12 -0700 (Fri, 09 Sep 2011)

Log Message

[V8] V8WebKitPoint::constructorCallback leaks
https://bugs.webkit.org/show_bug.cgi?id=67865

Reviewed by Adam Barth.

Covered by fast/js/instanceof-XMLHttpRequest.html under Valgrind.

* bindings/v8/custom/V8WebKitPointConstructor.cpp:
(WebCore::V8WebKitPoint::constructorCallback): Changed the code
to use a RefPtr (per our usual style). Also use toV8 that will
take care of properly wrapping the object.

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (94893 => 94894)


--- trunk/Source/WebCore/ChangeLog	2011-09-10 00:59:43 UTC (rev 94893)
+++ trunk/Source/WebCore/ChangeLog	2011-09-10 01:16:12 UTC (rev 94894)
@@ -1,3 +1,17 @@
+2011-09-09  Julien Chaffraix  <jchaffr...@webkit.org>
+
+        [V8] V8WebKitPoint::constructorCallback leaks
+        https://bugs.webkit.org/show_bug.cgi?id=67865
+
+        Reviewed by Adam Barth.
+
+        Covered by fast/js/instanceof-XMLHttpRequest.html under Valgrind.
+
+        * bindings/v8/custom/V8WebKitPointConstructor.cpp:
+        (WebCore::V8WebKitPoint::constructorCallback): Changed the code
+        to use a RefPtr (per our usual style). Also use toV8 that will
+        take care of properly wrapping the object.
+
 2011-09-09  Chris Rogers  <crog...@google.com>
 
         HRTFDatabaseLoader should not call WTF::waitForThreadCompletion() more than once

Modified: trunk/Source/WebCore/bindings/v8/custom/V8WebKitPointConstructor.cpp (94893 => 94894)


--- trunk/Source/WebCore/bindings/v8/custom/V8WebKitPointConstructor.cpp	2011-09-10 00:59:43 UTC (rev 94893)
+++ trunk/Source/WebCore/bindings/v8/custom/V8WebKitPointConstructor.cpp	2011-09-10 01:16:12 UTC (rev 94894)
@@ -61,10 +61,9 @@
                 y = 0;
         }
     }
-    PassRefPtr<WebKitPoint> point = WebKitPoint::create(x, y);
-    point->ref();
+    RefPtr<WebKitPoint> point = WebKitPoint::create(x, y);
     V8DOMWrapper::setDOMWrapper(args.Holder(), &info, point.get());
-    return args.Holder();
+    return toV8(point.release(), args.Holder());
 }
 
 } // namespace WebCore
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes

Reply via email to