Calling `self` inside a `struct` closure doesn't leak, because a `struct` is a value type, correct?

struct Foo {
var handler: (() -> Void)?
var bar: Bar // A class

func doSomething() {
bar.doSomething {
self.handler?() // <--- does it leak?
}
}
}

Additionally, if the `handler` closure is set by an object, it requires `[weak self]` during its closure definition? (edited)


You already invited:

If you wanna answer this question please Login or Register