From 5318470b70af517d61afcdabfca642fef080bd70 Mon Sep 17 00:00:00 2001 From: syeyoung Date: Sun, 22 Aug 2021 18:42:58 +0900 Subject: - Fix DG Calling Destructor on IDiscordCore that does not exist, causing SIGSEGV --- src/main/java/kr/syeyoung/dungeonsguide/rpc/RichPresenceManager.java | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'src/main') diff --git a/src/main/java/kr/syeyoung/dungeonsguide/rpc/RichPresenceManager.java b/src/main/java/kr/syeyoung/dungeonsguide/rpc/RichPresenceManager.java index c50e436e..e19a6fad 100644 --- a/src/main/java/kr/syeyoung/dungeonsguide/rpc/RichPresenceManager.java +++ b/src/main/java/kr/syeyoung/dungeonsguide/rpc/RichPresenceManager.java @@ -67,6 +67,7 @@ public class RichPresenceManager implements Runnable { public int setup() { if (iDiscordCore != null) { iDiscordCore.Destroy.destroy(iDiscordCore); + iDiscordCore = null; activityManager = null; callbacks = null; relation_callbacks = null; relationMap.clear(); } @@ -226,8 +227,10 @@ public class RichPresenceManager implements Runnable { while(!Thread.interrupted()) { try { if (iDiscordCore == null || setup) { + long lastSetup = lastSetupCode; lastSetupCode = setup(); - System.out.println("Discord returned "+lastSetupCode+" for setup "+EDiscordResult.fromValue(lastSetupCode)); + if (lastSetup != lastSetupCode) + System.out.println("Discord returned "+lastSetupCode+" for setup "+EDiscordResult.fromValue(lastSetupCode)); setup = lastSetupCode != EDiscordResult.DiscordResult_Ok.getValue(); counter = 0; } else { -- cgit