diff --git a/flixel/sound/FlxSound.hx b/flixel/sound/FlxSound.hx index 01478518a..d8ed4a78a 100644 --- a/flixel/sound/FlxSound.hx +++ b/flixel/sound/FlxSound.hx @@ -231,6 +231,9 @@ class FlxSound extends FlxBasic */ function reset():Void { + if (onFinish == null) + onFinish = new FlxSignal(); + destroy(); x = 0; @@ -251,9 +254,6 @@ class FlxSound extends FlxBasic amplitudeLeft = 0; amplitudeRight = 0; autoDestroy = false; - - if (onFinish == null) - onFinish = new FlxSignal(); if (_transform == null) _transform = new SoundTransform(); @@ -287,6 +287,8 @@ class FlxSound extends FlxBasic _sound = null; } + onFinish.removeAll(); + onComplete = null; super.destroy(); @@ -449,6 +451,7 @@ class FlxSound extends FlxBasic autoDestroy = AutoDestroy; updateTransform(); exists = true; + onFinish.removeAll(); onFinish.add(onComplete); onComplete = OnComplete; #if FLX_PITCH