[haxe] Add dispose function to starling. Add clearListeners to dispose/destroy.

This commit is contained in:
Davide Tantillo 2025-03-18 09:54:36 +01:00
parent e9ffad91c5
commit 34ccf846a9
2 changed files with 11 additions and 2 deletions

View File

@ -116,9 +116,9 @@ class SkeletonSprite extends FlxObject
override public function destroy():Void
{
skeleton = null;
state.clearListeners();
state = null;
stateData = null;
skeleton = null;
_tempVertices = null;
_quadTriangles = null;

View File

@ -416,4 +416,13 @@ class SkeletonSprite extends DisplayObject implements IAnimatable {
bone.worldToLocal(point);
}
}
override public function dispose():Void {
if (_state != null) {
_state.clearListeners();
_state = null;
}
if (_skeleton != null) _skeleton = null;
super.dispose();
}
}