From ea0e4ee56d0ce5b07a15d63ad17ea0e71b5e8860 Mon Sep 17 00:00:00 2001 From: MoonDroid <81515012+moondroidcoder@users.noreply.github.com> Date: Fri, 13 Jun 2025 09:45:36 +0700 Subject: [PATCH] fix: Remove all callbacks when destroyed --- source/funkin/mobile/ui/FunkinBackButton.hx | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/source/funkin/mobile/ui/FunkinBackButton.hx b/source/funkin/mobile/ui/FunkinBackButton.hx index 14d55656c..dde206786 100644 --- a/source/funkin/mobile/ui/FunkinBackButton.hx +++ b/source/funkin/mobile/ui/FunkinBackButton.hx @@ -94,6 +94,7 @@ class FunkinBackButton extends FunkinButton { FlxTween.cancelTweensOf(this); HapticUtil.vibrate(0, 0.01, 0.2); + animation.play('idle'); FlxTween.tween(this, {alpha: restingOpacity}, 0.5, {ease: FlxEase.expoOut}); } @@ -106,4 +107,11 @@ class FunkinBackButton extends FunkinButton if (FlxG.android.justReleased.BACK) onDown.dispatch(); #end } + + override function destroy():Void + { + super.destroy(); + onConfirmEnd.removeAll(); + if (animation != null && animation.onFinish != null) animation.onFinish.removeAll(); + } }