Memory leak when using WKScriptMessageHandler
问题 Not sure if I hit a bug in WebKit or I am doing something horribly wrong, but I can't figure out how to use WKScriptMessageHandler without causing whatever value contained in WKScriptMessage.body to leak. I was able to put together a minimum Mac project to isolate the issue, but to no avail. In the main view controller: class ViewController: NSViewController { var webView: WKWebView? override func viewDidLoad() { super.viewDidLoad() let userContentController = WKUserContentController()