Bug 201814

Summary: Fix leaks in DumpRenderTree and WebKitTestRunner
Product: WebKit Reporter: David Kilzer (:ddkilzer) <ddkilzer>
Component: Tools / TestsAssignee: David Kilzer (:ddkilzer) <ddkilzer>
Status: RESOLVED FIXED    
Severity: Normal CC: commit-queue, darin, joepeck, simon.fraser, webkit-bug-importer, wenson_hsieh
Priority: P2 Keywords: InRadar
Version: WebKit Nightly Build   
Hardware: Unspecified   
OS: Unspecified   
Attachments:
Description Flags
Patch v1
none
Patch v2
none
Patch v3 none

Description David Kilzer (:ddkilzer) 2019-09-15 22:32:18 PDT
Fix leaks in DumpRenderTree and WebKitTestRunner found by clang static analyzer.

Also clean up a function signature and add CF_RETURNS_RETAINED where necessary to document behavior.
Comment 1 Radar WebKit Bug Importer 2019-09-15 22:33:43 PDT
<rdar://problem/55387900>
Comment 2 David Kilzer (:ddkilzer) 2019-09-15 22:39:48 PDT
Created attachment 378842 [details]
Patch v1
Comment 3 David Kilzer (:ddkilzer) 2019-09-15 22:49:04 PDT
Created attachment 378846 [details]
Patch v2
Comment 4 David Kilzer (:ddkilzer) 2019-09-15 22:49:28 PDT
(In reply to David Kilzer (:ddkilzer) from comment #2)
> Created attachment 378842 [details]
> Patch v1

Apparently CGEventRelease() isn't a thing!
Comment 5 Wenson Hsieh 2019-09-15 22:55:47 PDT
Comment on attachment 378846 [details]
Patch v2

View in context: https://bugs.webkit.org/attachment.cgi?id=378846&action=review

> Tools/WebKitTestRunner/cocoa/TestRunnerWKWebView.mm:124
> +    self.didStartFormControlInteractionCallback = nil;
> +    self.didEndFormControlInteractionCallback = nil;
> +    self.didShowForcePressPreviewCallback = nil;
> +    self.didDismissForcePressPreviewCallback = nil;
> +    self.willBeginZoomingCallback = nil;
> +    self.didEndZoomingCallback = nil;
> +    self.didShowKeyboardCallback = nil;
> +    self.didHideKeyboardCallback = nil;
> +    self.didShowMenuCallback = nil;
> +    self.didHideMenuCallback = nil;
> +    self.willPresentPopoverCallback = nil;
> +    self.didDismissPopoverCallback = nil;
> +    self.didEndScrollingCallback = nil;
> +    self.rotationDidEndCallback = nil;

These should be taken care of by -resetInteractionCallbacks, no?
Comment 6 David Kilzer (:ddkilzer) 2019-09-16 05:20:38 PDT
Comment on attachment 378846 [details]
Patch v2

View in context: https://bugs.webkit.org/attachment.cgi?id=378846&action=review

>> Tools/WebKitTestRunner/cocoa/TestRunnerWKWebView.mm:124
>> +    self.rotationDidEndCallback = nil;
> 
> These should be taken care of by -resetInteractionCallbacks, no?

Oops!  You are correct.  Will remove.
Comment 7 David Kilzer (:ddkilzer) 2019-09-16 05:21:46 PDT
Created attachment 378855 [details]
Patch v3
Comment 8 WebKit Commit Bot 2019-09-16 09:27:00 PDT
Comment on attachment 378855 [details]
Patch v3

Clearing flags on attachment: 378855

Committed r249901: <https://trac.webkit.org/changeset/249901>
Comment 9 WebKit Commit Bot 2019-09-16 09:27:02 PDT
All reviewed patches have been landed.  Closing bug.