Bug 258051 - Stop autoreleasing WKWebView and WKContentView in WebKit::PageClientImplIOS
Summary: Stop autoreleasing WKWebView and WKContentView in WebKit::PageClientImplIOS
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebKit Misc. (show other bugs)
Version: Other
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: David Kilzer (:ddkilzer)
URL:
Keywords: InRadar
Depends on: 257938
Blocks:
  Show dependency treegraph
 
Reported: 2023-06-13 16:28 PDT by David Kilzer (:ddkilzer)
Modified: 2023-06-14 11:24 PDT (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description David Kilzer (:ddkilzer) 2023-06-13 16:28:36 PDT
Stop autoreleasing WKWebView and WKContentView in WebKit::PageClientImplIOS.

Since both m_webView and m_contentView are WeakObjCPtr<> instance variables, calling methods like `[m_webView bar]` results in autoreleasing `m_webView` every time.

Fix this by using convenience methods that call WeakObjCPtr<>::get() and return a RetainPtr<> instead.
Comment 1 Radar WebKit Bug Importer 2023-06-13 16:29:00 PDT
<rdar://problem/110740310>
Comment 2 David Kilzer (:ddkilzer) 2023-06-13 16:35:39 PDT
Pull request: https://github.com/WebKit/WebKit/pull/14938
Comment 3 EWS 2023-06-14 11:24:17 PDT
Committed 265157@main (3fe8f3b95be5): <https://commits.webkit.org/265157@main>

Reviewed commits have been landed. Closing PR #14938 and removing active labels.