-
Notifications
You must be signed in to change notification settings - Fork 81
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Added unowned references #5
Conversation
Thanks Ash. 👍 |
@ashfurrow was this solved with beta 3? |
Checking now. |
Nope – still exists. |
@ashfurrow does that exact example still breaks, or is your example (radar one) that still fails? |
Yup still crashing on both. For example: protocol MyProtocol: NSObjectProtocol {
func method()
}
class MyObject : NSObject {
unowned let delegate: MyProtocol
init(delegate: MyProtocol) {
self.delegate = delegate
super.init()
}
func doSomethingWithDelegate() {
delegate.method()
}
}
class DelegateClass: NSObject, MyProtocol {
func method () {
for i in 1...10 {
"Hello!"
}
}
} And later... let delegate = DelegateClass()
let object = MyObject(delegate: delegate)
object.doSomethingWithDelegate()
println("\(delegate)") // keep it from being released New stack trace though:
|
@ashfurrow It looks like the object is getting released before the unowned access, though it shouldn't in this case. Do you have a radar for this? This is a good test case. |
Yes, I've filed a radar. |
Huh. This seems similar to the sort of problems solved by the |
No description provided.