[ts][pixi] Fix memory leak due to not removing spine object from ticket. Close #2571.

This commit is contained in:
Davide Tantillo 2024-07-05 16:25:58 +02:00
parent a1f077d43c
commit b4fd5d7bdd

View File

@ -199,6 +199,7 @@ export class Spine extends Container {
/** Destroy Spine game object elements, then call the {@link Container.destroy} with the given options */ /** Destroy Spine game object elements, then call the {@link Container.destroy} with the given options */
public override destroy (options?: boolean | IDestroyOptions | undefined): void { public override destroy (options?: boolean | IDestroyOptions | undefined): void {
if (this.autoUpdate) this.autoUpdate = false;
for (const [, mesh] of this.meshesCache) { for (const [, mesh] of this.meshesCache) {
mesh?.destroy(); mesh?.destroy();
} }