aboutsummaryrefslogtreecommitdiff
path: root/src/main
diff options
context:
space:
mode:
authorsyeyoung <cyong06@naver.com>2021-08-22 18:42:58 +0900
committersyeyoung <cyong06@naver.com>2021-08-22 18:42:58 +0900
commit5318470b70af517d61afcdabfca642fef080bd70 (patch)
tree4f63dc019656844e684c6b958abfb99e5ddadc0b /src/main
parent91f20ae728578f1a39c2a842d21b94ba246f4842 (diff)
downloadSkyblock-Dungeons-Guide-5318470b70af517d61afcdabfca642fef080bd70.tar.gz
Skyblock-Dungeons-Guide-5318470b70af517d61afcdabfca642fef080bd70.tar.bz2
Skyblock-Dungeons-Guide-5318470b70af517d61afcdabfca642fef080bd70.zip
- Fix DG Calling Destructor on IDiscordCore that does not exist, causing SIGSEGV
Diffstat (limited to 'src/main')
-rw-r--r--src/main/java/kr/syeyoung/dungeonsguide/rpc/RichPresenceManager.java5
1 files changed, 4 insertions, 1 deletions
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 {