Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 13 additions & 1 deletion src/main-api/Inspector.ts
Original file line number Diff line number Diff line change
Expand Up @@ -297,7 +297,10 @@ export class Inspector {
private width = 1920;
private scaleX = 1;
private scaleY = 1;
private textureMetrics = new Map<Texture, TextureMetrics>();
// Keyed weakly: a texture that is swapped off a node is never revisited by
// the inspector, and a strong map would pin it (and its bitmap) for the
// lifetime of the renderer.
private textureMetrics = new WeakMap<Texture, TextureMetrics>();
// Stable reference so the same function can be passed to both
// add/removeEventListener — `.bind()` returns a new fn each call, so binding
// inline in destroy() would never actually remove the listener.
Expand Down Expand Up @@ -1042,6 +1045,15 @@ export class Inspector {
});
coreNodeListeners.clear();

// Animations still running when the node goes away never emit
// `stopped`, so their entry — and the controller it holds — would stay
// in the static activeAnimations map for the lifetime of the page.
Inspector.activeAnimations.forEach((animation, animationId) => {
if (animation.nodeId === node.id) {
this.trackAnimationEnd(animationId, 'cancelled');
}
});

this.destroyNode(node);
originalDestroy.call(node, isChild);
},
Expand Down
Loading