Skip to content

Commit

Permalink
[FIX] DiscordRPC Double shutdown
Browse files Browse the repository at this point in the history
  • Loading branch information
Gravit committed Apr 4, 2020
1 parent dc5b56a commit 8c4b91f
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -72,20 +72,20 @@ private void launcherInit(ClientEngineInitPhase phase)
private void exitHandler(ClientExitPhase phase)
{
if(isClosed) return;
isClosed = true;
if(DiscordRPC.thr != null) DiscordRPC.thr.interrupt();
if(DiscordRPC.lib != null) DiscordRPC.lib.Discord_Shutdown();
if(RequestEventWatcher.INSTANCE != null) Request.service.unregisterEventHandler(RequestEventWatcher.INSTANCE);
isClosed = true;
}
public static boolean isClosed = false;
private void exitByStartClient(ClientProcessBuilderParamsWrittedEvent event)
{
if(isClosed) return;
try {
isClosed = true;
if(DiscordRPC.thr != null) DiscordRPC.thr.interrupt();
if(DiscordRPC.lib != null) DiscordRPC.lib.Discord_Shutdown();
if(RequestEventWatcher.INSTANCE != null) Request.service.unregisterEventHandler(RequestEventWatcher.INSTANCE);
isClosed = true;
} catch (Throwable ignored)
{

Expand Down

0 comments on commit 8c4b91f

Please sign in to comment.