remove recursion
This commit is contained in:
parent
f65e4b7269
commit
06ce971112
|
@ -19,12 +19,14 @@ std::string lastMediaSource = "";
|
||||||
std::string currentSongTitle = "";
|
std::string currentSongTitle = "";
|
||||||
|
|
||||||
void handleRPCTasks() {
|
void handleRPCTasks() {
|
||||||
|
while (true) {
|
||||||
while (true) {
|
while (true) {
|
||||||
DiscordEventHandlers discordHandler{};
|
DiscordEventHandlers discordHandler{};
|
||||||
auto app = utils::getApp(lastMediaSource);
|
auto app = utils::getApp(lastMediaSource);
|
||||||
Discord_Initialize(app.clientId.c_str(), &discordHandler);
|
Discord_Initialize(app.clientId.c_str(), &discordHandler);
|
||||||
if (Discord_IsConnected())
|
if (Discord_IsConnected())
|
||||||
break;
|
break;
|
||||||
|
std::this_thread::sleep_for(std::chrono::seconds(1));
|
||||||
}
|
}
|
||||||
while (true) {
|
while (true) {
|
||||||
Discord_RunCallbacks();
|
Discord_RunCallbacks();
|
||||||
|
@ -33,7 +35,7 @@ void handleRPCTasks() {
|
||||||
std::this_thread::sleep_for(std::chrono::seconds(1));
|
std::this_thread::sleep_for(std::chrono::seconds(1));
|
||||||
}
|
}
|
||||||
Discord_Shutdown();
|
Discord_Shutdown();
|
||||||
handleRPCTasks(); // this could theoretically cause a stack overflow if discord is restarted often enough
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void handleMediaTasks() {
|
void handleMediaTasks() {
|
||||||
|
|
Loading…
Reference in New Issue