From 76ebfef57193aa019848b25fc289a24cf42fec04 Mon Sep 17 00:00:00 2001 From: Kade M Date: Fri, 2 Apr 2021 14:35:14 -0700 Subject: [PATCH 1/2] close the thing on the dead --- source/TitleState.hx | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/source/TitleState.hx b/source/TitleState.hx index c91dc54eb..e643ac1a8 100644 --- a/source/TitleState.hx +++ b/source/TitleState.hx @@ -96,6 +96,10 @@ class TitleState extends MusicBeatState #if desktop DiscordClient.initialize(); + + Application.current.onExit.add (function (exitCode) { + DiscordClient.shutdown(); + }); #end } From c07533c0c3c117ecdbd97f20bf8bcdf0e162e052 Mon Sep 17 00:00:00 2001 From: Kade M Date: Fri, 2 Apr 2021 14:37:58 -0700 Subject: [PATCH 2/2] add the fucntioln --- source/Discord.hx | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/source/Discord.hx b/source/Discord.hx index 253a4f59a..2802e87c7 100644 --- a/source/Discord.hx +++ b/source/Discord.hx @@ -28,6 +28,11 @@ class DiscordClient DiscordRpc.shutdown(); } + public static function shutdown() + { + DiscordRpc.shutdown(); + } + static function onReady() { DiscordRpc.presence({