Forráskód Böngészése

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

Davide Tantillo 1 éve
szülő
commit
b4fd5d7bdd
1 módosított fájl, 1 hozzáadás és 0 törlés
  1. 1 0
      spine-ts/spine-pixi/src/Spine.ts

+ 1 - 0
spine-ts/spine-pixi/src/Spine.ts

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