Open swift-ci opened 7 years ago
Attachment: Download
Issue Description:
Here is my code: I have the ViewWithCollectionView on my story board. It's just a simple empty view created for this example.
I have set my delegate as unowned, but Xcode Leaks still show this as a leak, and I do not understand why.
import UIKit class ViewController: UIViewController { @IBOutlet weak var theView: ViewWithCollectionView! override func viewDidLoad() { super.viewDidLoad() } } class ViewWithCollectionView: UICollectionView, SomeProtocol { override func awakeFromNib() { collectionViewLayout = SomeLayout(with: self) } } open class SomeLayout: UICollectionViewLayout, SomeProtocol { unowned var delegate: SomeProtocol init(with delegate: SomeProtocol) { self.delegate = delegate // Leak happens here super.init() } required public init?(coder aDecoder: NSCoder) { fatalError("init(coder:) has not been implemented") } } protocol SomeProtocol: class {}
I suspect this is the same issue we had with weak. @jckarter, @slavapestov?
weak
I don't recall what that issue was. Got a link, @belkadan?
Attachment: Download
Environment
XCode 8, swift 3, OS Sierra, iOS 7plus Simulator, iOS 10.3Additional Detail from JIRA
| | | |------------------|-----------------| |Votes | 0 | |Component/s | Compiler | |Labels | Bug | |Assignee | None | |Priority | Medium | md5: b076ea3ea4c599909691dc74ed03b68dIssue Description:
Here is my code: I have the ViewWithCollectionView on my story board. It's just a simple empty view created for this example.
I have set my delegate as unowned, but Xcode Leaks still show this as a leak, and I do not understand why.