Fix JSClassRef leak.
authorweinig@apple.com <weinig@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 3 Dec 2009 21:25:24 +0000 (21:25 +0000)
committerweinig@apple.com <weinig@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 3 Dec 2009 21:25:24 +0000 (21:25 +0000)
Reviewed by Gavin Barraclough.

* DumpRenderTree/AccessibilityController.cpp:
(AccessibilityController::makeWindowObject):
* DumpRenderTree/GCController.cpp:
(GCController::makeWindowObject):
* DumpRenderTree/LayoutTestController.cpp:
(LayoutTestController::makeWindowObject):

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

WebKitTools/ChangeLog
WebKitTools/DumpRenderTree/AccessibilityController.cpp
WebKitTools/DumpRenderTree/GCController.cpp
WebKitTools/DumpRenderTree/LayoutTestController.cpp

index ad865ff4dd1c899e4d2ff892148753f31ac89fdd..75803d4e8a9fba960ba0576fbd6d77fccc6bb9ea 100644 (file)
@@ -1,3 +1,16 @@
+2009-12-03  Sam Weinig  <sam@webkit.org>
+
+        Reviewed by Gavin Barraclough.
+
+        Fix JSClassRef leak.
+
+        * DumpRenderTree/AccessibilityController.cpp:
+        (AccessibilityController::makeWindowObject):
+        * DumpRenderTree/GCController.cpp:
+        (GCController::makeWindowObject):
+        * DumpRenderTree/LayoutTestController.cpp:
+        (LayoutTestController::makeWindowObject):
+
 2009-12-03  Brady Eidson  <beidson@apple.com>
 
         Reviewed by Sam Weinig.
index ea8b835e6dfa8b4086be6ca1328a2b3db618629a..d3688f441252264df7485e70c7401eb4a86e13a3 100644 (file)
@@ -48,7 +48,11 @@ static JSValueRef getRootElementCallback(JSContextRef context, JSObjectRef thisO
 void AccessibilityController::makeWindowObject(JSContextRef context, JSObjectRef windowObject, JSValueRef* exception)
 {
     JSRetainPtr<JSStringRef> accessibilityControllerStr(Adopt, JSStringCreateWithUTF8CString("accessibilityController"));
-    JSValueRef accessibilityControllerObject = JSObjectMake(context, getJSClass(), this);
+    
+    JSClassRef classRef = getJSClass();
+    JSValueRef accessibilityControllerObject = JSObjectMake(context, classRef, this);
+    JSClassRelease(classRef);
+
     JSObjectSetProperty(context, windowObject, accessibilityControllerStr.get(), accessibilityControllerObject, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete, exception);
 }
 
index 12aadbf08e113a0923ec80270e72d8825241ea22..06a04fbca51b30c87e72a089aab99a6924973b3c 100644 (file)
@@ -74,7 +74,11 @@ static JSValueRef getJSObjectCountCallback(JSContextRef context, JSObjectRef fun
 void GCController::makeWindowObject(JSContextRef context, JSObjectRef windowObject, JSValueRef* exception)
 {
     JSRetainPtr<JSStringRef> gcControllerStr(Adopt, JSStringCreateWithUTF8CString("GCController"));
-    JSValueRef gcControllerObject = JSObjectMake(context, getJSClass(), this);
+
+    JSClassRef classRef = getJSClass();
+    JSValueRef gcControllerObject = JSObjectMake(context, classRef, this);
+    JSClassRelease(classRef);
+
     JSObjectSetProperty(context, windowObject, gcControllerStr.get(), gcControllerObject, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete, exception);
 }
 
index fcc527b2a830a1a937ca71a0fd45547492e199be..572d610633d71507713b4647b4896d73395579a6 100644 (file)
@@ -1189,7 +1189,11 @@ void LayoutTestController::makeWindowObject(JSContextRef context, JSObjectRef wi
 {
     JSRetainPtr<JSStringRef> layoutTestContollerStr(Adopt, JSStringCreateWithUTF8CString("layoutTestController"));
     ref();
-    JSValueRef layoutTestContollerObject = JSObjectMake(context, getJSClass(), this);
+
+    JSClassRef classRef = getJSClass();
+    JSValueRef layoutTestContollerObject = JSObjectMake(context, classRef, this);
+    JSClassRelease(classRef);
+
     JSObjectSetProperty(context, windowObject, layoutTestContollerStr.get(), layoutTestContollerObject, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete, exception);
 }