admin管理员组文章数量:1122846
I noticed that Leaks instrument detects memory leaks when UIActivityViewController is presented/dismissed and when it contains a web link.
Code is as simple as:
let textToShare = "Some text"
let urlToShare = URL(string: ";)!
let activityViewController = UIActivityViewController(activityItems: [textToShare, urlToShare], applicationActivities: nil)
present(activityViewController, animated: true)
Here is a screenshot of Leaks. The first red check finds 25 leaks, then controller get dismissed and then the second red check finds 17 new leaks. Tested on iOS 16.4 simulator. Amount of leaks varies.
The interesting thing is if you remove links from this controller, memory leaks are gone.
Pushing this controller is also followed by these messages in debugger:
[assertion] Error acquiring assertion: <Error Domain=RBSServiceErrorDomain Code=1 "target is not running or doesn't have entitlement com.apple.runningboard.assertions.webkit" UserInfo={NSLocalizedFailureReason=target is not running or doesn't have entitlement com.apple.runningboard.assertions.webkit}>
and
Could not signal service com.apple.WebKit.WebContent: 113: Could not find specified service
I tested it out on a real device with iOS 18.2, same results.
Any idea why this is happening and how to prevent it?
Xcode 16.1
本文标签: swiftMemory leaks when using links in UIActivityViewControllerStack Overflow
版权声明:本文标题:swift - Memory leaks when using links in UIActivityViewController - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1736282948a1926807.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论