<div dir="ltr">Hey,<div><br></div><div>I am experiencing this strange crashing when capturing an instance of a @objc class (written in swift, but annotated with @objc and subclass of NSObject). It happens when the closure is being assigned and not when called, so the problem is not that the captured value would get deallocated and then the closure called. It happens randomly, sometimes it crashes sooner, sometimes later. I was experiencing this bug in earlier versions of Swift (I think it was Swift 1.2), but now I&#39;m using 2.1 and getting this crash too.</div><div><br></div><div>It works well when I change `[unowned x]` to `[weak x]` and then access it by force unwrapping `x!.doSomething()` which leads me to believe it is a bug in Swift, rather than in my code. However before opening a ticket at <a href="http://bugs.swift.org">bugs.swift.org</a>, I wanted to get more eyes on this to make sure I&#39;m not missing anything.</div><div><br></div><div>It was also mentioned here:</div><div><a href="http://www.codeproject.com/Articles/791304/Resolving-strong-references-between-Swift-and-Obje">http://www.codeproject.com/Articles/791304/Resolving-strong-references-between-Swift-and-Obje</a><br></div><div>here:</div><div><a href="https://www.reddit.com/r/swift/comments/3vhwmj/unowned_bug_in_closure_causes_attempted_to_retain/">https://www.reddit.com/r/swift/comments/3vhwmj/unowned_bug_in_closure_causes_attempted_to_retain/</a><br></div><div>and here:</div><div><a href="https://forums.developer.apple.com/thread/9873">https://forums.developer.apple.com/thread/9873</a><br></div></div>