Title: [245430] trunk
Revision
245430
Author
[email protected]
Date
2019-05-16 18:17:47 -0700 (Thu, 16 May 2019)

Log Message

REGRESSION (r15133): Fix leak of JSStringRef in minidom
<https://webkit.org/b/197968>
<rdar://problem/50872430>

Reviewed by Joseph Pecoraro.

Source/_javascript_Core:

* API/tests/minidom.c:
(print): Call JSStringRelease() to fix the leak.

Tools:

* TestWebKitAPI/Tests/WebKitObjC/UserContentTest.mm:
(expectScriptValueIsString): Drive-by fix to use adopt() instead
of JSRetainPtr<JSStringRef> string(Adopt, JSValueToStringCopy(...)).

Modified Paths

Diff

Modified: trunk/Source/_javascript_Core/API/tests/minidom.c (245429 => 245430)


--- trunk/Source/_javascript_Core/API/tests/minidom.c	2019-05-17 00:07:44 UTC (rev 245429)
+++ trunk/Source/_javascript_Core/API/tests/minidom.c	2019-05-17 01:17:47 UTC (rev 245430)
@@ -91,6 +91,7 @@
         char stringUTF8[numChars];
         JSStringGetUTF8CString(string, stringUTF8, numChars);
         printf("%s\n", stringUTF8);
+        JSStringRelease(string);
     }
     
     return JSValueMakeUndefined(context);

Modified: trunk/Source/_javascript_Core/ChangeLog (245429 => 245430)


--- trunk/Source/_javascript_Core/ChangeLog	2019-05-17 00:07:44 UTC (rev 245429)
+++ trunk/Source/_javascript_Core/ChangeLog	2019-05-17 01:17:47 UTC (rev 245430)
@@ -1,3 +1,14 @@
+2019-05-16  David Kilzer  <[email protected]>
+
+        REGRESSION (r15133): Fix leak of JSStringRef in minidom
+        <https://webkit.org/b/197968>
+        <rdar://problem/50872430>
+
+        Reviewed by Joseph Pecoraro.
+
+        * API/tests/minidom.c:
+        (print): Call JSStringRelease() to fix the leak.
+
 2019-05-16  Ross Kirsling  <[email protected]>
 
         [JSC] Invalid AssignmentTargetType should be an early error.

Modified: trunk/Tools/ChangeLog (245429 => 245430)


--- trunk/Tools/ChangeLog	2019-05-17 00:07:44 UTC (rev 245429)
+++ trunk/Tools/ChangeLog	2019-05-17 01:17:47 UTC (rev 245430)
@@ -1,5 +1,17 @@
 2019-05-16  David Kilzer  <[email protected]>
 
+        REGRESSION (r15133): Fix leak of JSStringRef in minidom
+        <https://webkit.org/b/197968>
+        <rdar://problem/50872430>
+
+        Reviewed by Joseph Pecoraro.
+
+        * TestWebKitAPI/Tests/WebKitObjC/UserContentTest.mm:
+        (expectScriptValueIsString): Drive-by fix to use adopt() instead
+        of JSRetainPtr<JSStringRef> string(Adopt, JSValueToStringCopy(...)).
+
+2019-05-16  David Kilzer  <[email protected]>
+
         REGRESSION (r84160): Leak of OpaqueJSString under WTR::JSTestRunner::pathToLocalResource (32 bytes) in com.apple.WebKit.WebContent running layout tests
         <https://webkit.org/b/197965>
 

Modified: trunk/Tools/TestWebKitAPI/Tests/WebKitObjC/UserContentTest.mm (245429 => 245430)


--- trunk/Tools/TestWebKitAPI/Tests/WebKitObjC/UserContentTest.mm	2019-05-17 00:07:44 UTC (rev 245429)
+++ trunk/Tools/TestWebKitAPI/Tests/WebKitObjC/UserContentTest.mm	2019-05-17 01:17:47 UTC (rev 245430)
@@ -77,7 +77,7 @@
     JSValueRef scriptValue = WKSerializedScriptValueDeserialize(serializedScriptValue, scriptContext, 0);
     EXPECT_TRUE(JSValueIsString(scriptContext, scriptValue));
     
-    JSRetainPtr<JSStringRef> scriptString(Adopt, JSValueToStringCopy(scriptContext, scriptValue, 0));
+    auto scriptString = adopt(JSValueToStringCopy(scriptContext, scriptValue, 0));
     EXPECT_TRUE(JSStringIsEqualToUTF8CString(scriptString.get(), expectedValue));
     
     JSGlobalContextRelease(scriptContext);
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to