Changeset 244703 in webkit


Ignore:
Timestamp:
Apr 26, 2019 11:32:46 AM (5 years ago)
Author:
ddkilzer@apple.com
Message:

WebKitTestRunner leaks an NSDictionary and multiple JSStringRef objects
<https://webkit.org/b/197314>
<rdar://problem/50245252>

Reviewed by Simon Fraser.

  • WebKitTestRunner/UIScriptControllerCocoa.mm:

(WTR::UIScriptController::lastUndoLabel const):
(WTR::UIScriptController::firstRedoLabel const):

  • Use adopt(JSStringCreateWithCFString(...)) to fix leaks.
  • WebKitTestRunner/ios/HIDEventGenerator.mm:

(-[HIDEventGenerator sendEventStream:completionBlock:]):

  • Call -autorelease to fix leak of NSDictionary.
  • WebKitTestRunner/ios/UIScriptControllerIOS.mm:

(WTR::UIScriptController::accessibilitySpeakSelectionContent const):
(WTR::UIScriptController::selectFormPopoverTitle const):
(WTR::UIScriptController::textContentType const):
(WTR::UIScriptController::formInputLabel const):
(WTR::UIScriptController::scrollingTreeAsText const):

  • Use adopt(JSStringCreateWithCFString(...)) to fix leaks.
Location:
trunk/Tools
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/Tools/ChangeLog

    r244701 r244703  
     12019-04-26  David Kilzer  <ddkilzer@apple.com>
     2
     3        WebKitTestRunner leaks an NSDictionary and multiple JSStringRef objects
     4        <https://webkit.org/b/197314>
     5        <rdar://problem/50245252>
     6
     7        Reviewed by Simon Fraser.
     8
     9        * WebKitTestRunner/UIScriptControllerCocoa.mm:
     10        (WTR::UIScriptController::lastUndoLabel const):
     11        (WTR::UIScriptController::firstRedoLabel const):
     12        - Use adopt(JSStringCreateWithCFString(...)) to fix leaks.
     13
     14        * WebKitTestRunner/ios/HIDEventGenerator.mm:
     15        (-[HIDEventGenerator sendEventStream:completionBlock:]):
     16        - Call -autorelease to fix leak of NSDictionary.
     17
     18        * WebKitTestRunner/ios/UIScriptControllerIOS.mm:
     19        (WTR::UIScriptController::accessibilitySpeakSelectionContent const):
     20        (WTR::UIScriptController::selectFormPopoverTitle const):
     21        (WTR::UIScriptController::textContentType const):
     22        (WTR::UIScriptController::formInputLabel const):
     23        (WTR::UIScriptController::scrollingTreeAsText const):
     24        - Use adopt(JSStringCreateWithCFString(...)) to fix leaks.
     25
    1262019-04-26  Jonathan Bedard  <jbedard@apple.com>
    227
  • trunk/Tools/WebKitTestRunner/UIScriptControllerCocoa.mm

    r242339 r244703  
    152152JSRetainPtr<JSStringRef> UIScriptController::lastUndoLabel() const
    153153{
    154     return JSStringCreateWithCFString((__bridge CFStringRef)platformUndoManager().undoActionName);
     154    return adopt(JSStringCreateWithCFString((__bridge CFStringRef)platformUndoManager().undoActionName));
    155155}
    156156
    157157JSRetainPtr<JSStringRef> UIScriptController::firstRedoLabel() const
    158158{
    159     return JSStringCreateWithCFString((__bridge CFStringRef)platformUndoManager().redoActionName);
     159    return adopt(JSStringCreateWithCFString((__bridge CFStringRef)platformUndoManager().redoActionName));
    160160}
    161161
  • trunk/Tools/WebKitTestRunner/ios/HIDEventGenerator.mm

    r241734 r244703  
    11391139   
    11401140    NSDictionary* threadData = @{
    1141         @"eventInfo": [eventInfo copy],
     1141        @"eventInfo": [[eventInfo copy] autorelease],
    11421142        @"completionBlock": [[completionBlock copy] autorelease]
    11431143    };
  • trunk/Tools/WebKitTestRunner/ios/UIScriptControllerIOS.mm

    r244370 r244703  
    199199{
    200200    TestRunnerWKWebView *webView = TestController::singleton().mainWebView()->platformView();
    201     return JSStringCreateWithCFString((CFStringRef)webView.accessibilitySpeakSelectionContent);
     201    return adopt(JSStringCreateWithCFString((CFStringRef)webView.accessibilitySpeakSelectionContent));
    202202}
    203203
     
    500500{
    501501    TestRunnerWKWebView *webView = TestController::singleton().mainWebView()->platformView();
    502     return JSStringCreateWithCFString((CFStringRef)webView.selectFormPopoverTitle);
     502    return adopt(JSStringCreateWithCFString((CFStringRef)webView.selectFormPopoverTitle));
    503503}
    504504
     
    506506{
    507507    TestRunnerWKWebView *webView = TestController::singleton().mainWebView()->platformView();
    508     return JSStringCreateWithCFString((CFStringRef)(webView.textContentTypeForTesting ?: @""));
     508    return adopt(JSStringCreateWithCFString((CFStringRef)(webView.textContentTypeForTesting ?: @"")));
    509509}
    510510
     
    512512{
    513513    TestRunnerWKWebView *webView = TestController::singleton().mainWebView()->platformView();
    514     return JSStringCreateWithCFString((CFStringRef)webView.formInputLabel);
     514    return adopt(JSStringCreateWithCFString((CFStringRef)webView.formInputLabel));
    515515}
    516516
     
    752752{
    753753    TestRunnerWKWebView *webView = TestController::singleton().mainWebView()->platformView();
    754     return JSStringCreateWithCFString((CFStringRef)[webView _scrollingTreeAsText]);
     754    return adopt(JSStringCreateWithCFString((CFStringRef)[webView _scrollingTreeAsText]));
    755755}
    756756
Note: See TracChangeset for help on using the changeset viewer.