Bug 193340 - Cleanup possible WK*Copy/Create leaks in WebKitTestRunner
Summary: Cleanup possible WK*Copy/Create leaks in 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: Joseph Pecoraro
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2019-01-10 14:44 PST by Joseph Pecoraro
Modified: 2019-01-14 06:51 PST (History)
6 users (show)

See Also:


Attachments
[PATCH] Proposed Fix (5.90 KB, patch)
2019-01-10 14:46 PST, Joseph Pecoraro
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Joseph Pecoraro 2019-01-10 14:44:59 PST
Cleanup possible WK*Copy/Create leaks in WebKitTestRunner

Searching for lines with WK.*?Create / WK.*?Copy that don't use WKRetainPtr or improperly use it.
Comment 1 Joseph Pecoraro 2019-01-10 14:46:43 PST
Created attachment 358838 [details]
[PATCH] Proposed Fix
Comment 2 David Kilzer (:ddkilzer) 2019-01-11 12:54:06 PST
Comment on attachment 358838 [details]
[PATCH] Proposed Fix

r=me
Comment 3 WebKit Commit Bot 2019-01-11 13:04:15 PST
Comment on attachment 358838 [details]
[PATCH] Proposed Fix

Clearing flags on attachment: 358838

Committed r239871: <https://trac.webkit.org/changeset/239871>
Comment 4 WebKit Commit Bot 2019-01-11 13:04:17 PST
All reviewed patches have been landed.  Closing bug.
Comment 5 Radar WebKit Bug Importer 2019-01-11 13:05:28 PST
<rdar://problem/47217944>
Comment 6 Darin Adler 2019-01-14 06:51:08 PST
Comment on attachment 358838 [details]
[PATCH] Proposed Fix

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

> Tools/WebKitTestRunner/InjectedBundle/InjectedBundle.cpp:434
> +        WKRetainPtr<WKStringRef> totalPrevalentResourcesKey(AdoptWK, WKStringCreateWithUTF8CString("TotalPrevalentResources"));
> +        WKRetainPtr<WKStringRef> totalPrevalentResourcesWithUserInteractionKey(AdoptWK, WKStringCreateWithUTF8CString("TotalPrevalentResourcesWithUserInteraction"));
> +        WKRetainPtr<WKStringRef> top3SubframeUnderTopFrameOriginsKey(AdoptWK, WKStringCreateWithUTF8CString("Top3SubframeUnderTopFrameOrigins"));

Please use the adoptWK function, not the special AdoptWK constructor, in new code. We want to get rid of those special constructors some day.