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
Tried to make the reproduction as simple as possible. Basically if you have an each inside an if or an unless statement and then transition to the inverse you leak BuiltInStreamHelpers and a bunch of related morphs and DOM fragments.
If you do a heap snapshot you'll see when hiding the each the only thing that is cleaned up for the rendered templates is the HTMLbarsMorph. 50 of these are deleted coresponding to the 50 items in the list.
If you compare this to an unless statement without an inverse, much more is cleaned up when the list is removed.
Thanks @rwjblue for batting this one back and forth, it was a pain to reproduce.
The text was updated successfully, but these errors were encountered:
I have a bead on this. Random mind dump as follows:
calling either `options.template.yield()` or `options.inverse.yield()` in `if` sets `renderState.morphToClear` to `null`
so when the `renderAndCleanup` code runs it doesn't clear
this is good generally, when rendering `template.yield()` after `template.yield()`
so if `morphToClear` was last populated by `template` and we are rendering `template` now, clobber (this is what it does now all the time)
but if `morphToclear` was last populated by `template` and we are rendering `inverse`, we need to clear before rendering
The solution is to ensure that if we are not the same template as was last yielded, we need to clear the morph before rendering. I have the fix, and am working on the tests.
Tried to make the reproduction as simple as possible. Basically if you have an
each
inside anif
or anunless
statement and then transition to the inverse you leakBuiltInStreamHelpers
and a bunch of related morphs and DOM fragments.Reproduction: http://output.jsbin.com/zusuno
If you do a heap snapshot you'll see when hiding the each the only thing that is cleaned up for the rendered templates is the
HTMLbarsMorph
. 50 of these are deleted coresponding to the 50 items in the list.If you compare this to an
unless
statement without an inverse, much more is cleaned up when the list is removed.Thanks @rwjblue for batting this one back and forth, it was a pain to reproduce.
The text was updated successfully, but these errors were encountered: