I just read that local variable lives only until the function in which it is declared ends.
Thank you all for answers. My main problem was that those two statements contradict each other. So which one is true? I guess the contradiction is only superficial.
I would guess the garbage collector would wipe the "closed" variable...
Well now, sorry for being so verbose, I guess I need to practice more the rubber duck techniqe.
I just realised that we declare a local variable in closure and then the garbage collector does not wipe the variable since we hold the reference from the returned object, right?
So? Memory leaks? Any option to check the list of such variables and clean them?