I was wondering what happens if one subscribes from within a callback function i.e. on-click? Are any of the four subscription layers compromised at all?
I guess I don’t get the “it might not be freed”. It seems the mem leak happens by chance not for sure
If the sub is also used in a view, then it will be freed when the view is unmounted. If the sub is not used in any view, there will be a leak.
Great! Thanks.
It's somewhere in the FAQ I believe. It will create a leak since the subs will be cached but will never be pruned.
My bad - not yet: https://github.com/day8/re-frame/pull/565
@lucio The subscribe
and the subsequent dereference should happen in the render phase. Not much later when an on-click
handler is called.