Some destroyables aren't destroyed
Opened this issue · 1 comments
swastik commented
I'm not familiar with Glimmer internals, so I'm not sure if this is an issue or if it works as intended, but here's a pretty simple Ember app that inserts 100 divs on click, then clears them out. If I enable destroy tracking, then assert it's all destroyed later, that seems like it doesn't quite happen.
In our actual app, this seems to retain a ton of these destroyables that should (?) be destroyed at this point but aren't for some reason.
Screen.Recording.2023-10-09.at.14.20.24.mov
Code:
@tracked items = [];
@tracked count = 0;
@action addItems() {
this.items = [
...this.items,
...Array(100)
.fill(0)
.map((_, i) => i),
];
}
@action clear() {
this.items = [];
}
swastik commented
I have a feeling these APIs are intended only for tests, but I'm not seeing everything being destroyed in tests either. 🤔