You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If you observe an object, I think it stays in memory after all references to it are gone (even if you unobserve it).
I'm not certain, but I suspect that the beforeDict is what's holding on to it. When the observer is created, we push onto the array, but we never splice it out.
It would be great if we could use weak references in that array, but I don't think that's possible in JavaScript. Can we just splice it in the unobserve function?
The text was updated successfully, but these errors were encountered:
Runnable example
If you
observe
an object, I think it stays in memory after all references to it are gone (even if youunobserve
it).I'm not certain, but I suspect that the
beforeDict
is what's holding on to it. When the observer is created, wepush
onto the array, but we neversplice
it out.It would be great if we could use weak references in that array, but I don't think that's possible in JavaScript. Can we just splice it in the unobserve function?
The text was updated successfully, but these errors were encountered: