Swift closure memory problem


(Alon Muroch) #1

Hi everyone !
Its my first time writing here so i hope i could contribute.

The following code seems to create a retain cycle that doesn't let
SomeClass1 to release. Am i missing something ?

​​Alon.


(Joe Groff) #2

What are you passing as `topClosure`?

-Joe

···

On May 27, 2016, at 3:57 AM, Alon Muroch via swift-users <swift-users@swift.org> wrote:

Hi everyone !
Its my first time writing here so i hope i could contribute.

The following code seems to create a retain cycle that doesn't let SomeClass1 to release. Am i missing something ?

<Screen Shot 2016-05-27 at 10.00.21 AM.png>
​​Alon.


(Joe Groff) #3

for example { () -> Void
}

Can you please paste a complete example of code that triggers a leak, as text?

-Joe

···

On May 27, 2016, at 11:42 AM, Alon Muroch <alonmuroch@gmail.com> wrote:

On Fri, May 27, 2016 at 7:59 PM, Joe Groff <jgroff@apple.com> wrote:

> On May 27, 2016, at 3:57 AM, Alon Muroch via swift-users <swift-users@swift.org> wrote:
>
> Hi everyone !
> Its my first time writing here so i hope i could contribute.
>
> The following code seems to create a retain cycle that doesn't let SomeClass1 to release. Am i missing something ?
>
> <Screen Shot 2016-05-27 at 10.00.21 AM.png>
> ​​Alon.

What are you passing as `topClosure`?

-Joe