From 195f366b6571b5a2dc99d6b2058a6b87b9c65a64 Mon Sep 17 00:00:00 2001 From: EliteMasterEric Date: Wed, 27 Mar 2024 17:43:15 -0400 Subject: [PATCH] Fix an issue where the Random button would crash Freeplay. --- source/funkin/audio/FunkinSound.hx | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/source/funkin/audio/FunkinSound.hx b/source/funkin/audio/FunkinSound.hx index 6520ff27f..56b36d5df 100644 --- a/source/funkin/audio/FunkinSound.hx +++ b/source/funkin/audio/FunkinSound.hx @@ -399,10 +399,16 @@ class FunkinSound extends FlxSound implements ICloneable return sound; } + @:nullSafety(Off) public override function destroy():Void { // trace('[FunkinSound] Destroying sound "${this._label}"'); super.destroy(); + if (fadeTween != null) + { + fadeTween.cancel(); + fadeTween = null; + } FlxTween.cancelTweensOf(this); this._label = 'unknown'; }