Bug 201814 - Fix leaks in DumpRenderTree and WebKitTestRunner
Summary: Fix leaks in DumpRenderTree and WebKitTestRunner
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Tools / Tests (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: David Kilzer (:ddkilzer)
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2019-09-15 22:32 PDT by David Kilzer (:ddkilzer)
Modified: 2019-09-16 09:27 PDT (History)
6 users (show)

See Also:


Attachments
Patch v1 (6.50 KB, patch)
2019-09-15 22:39 PDT, David Kilzer (:ddkilzer)
no flags Details | Formatted Diff | Diff
Patch v2 (6.50 KB, patch)
2019-09-15 22:49 PDT, David Kilzer (:ddkilzer)
no flags Details | Formatted Diff | Diff
Patch v3 (5.52 KB, patch)
2019-09-16 05:21 PDT, David Kilzer (:ddkilzer)
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
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.