From f25d833dbd013ee215b1f4e0afa556362dba5ad6 Mon Sep 17 00:00:00 2001 From: Sleepy Flower Girl Date: Thu, 31 May 2018 22:56:31 -0400 Subject: [PATCH] Fixed issue Discord RPC library not clearing presence during shutdown --- Externals/discord-rpc/src/discord_rpc.cpp | 3 ++- Externals/licenses.md | 2 ++ Source/Core/UICommon/UICommon.vcxproj | 2 +- Source/UnitTests/UnitTests.vcxproj | 4 ++-- Source/VSProps/Base.props | 2 +- 5 files changed, 8 insertions(+), 5 deletions(-) diff --git a/Externals/discord-rpc/src/discord_rpc.cpp b/Externals/discord-rpc/src/discord_rpc.cpp index dedb3f1539..2e44c939ce 100644 --- a/Externals/discord-rpc/src/discord_rpc.cpp +++ b/Externals/discord-rpc/src/discord_rpc.cpp @@ -89,10 +89,11 @@ public: keepRunning.store(true); ioThread = std::thread([&]() { const std::chrono::duration maxWait{500LL}; + Discord_UpdateConnection(); while (keepRunning.load()) { - Discord_UpdateConnection(); std::unique_lock lock(waitForIOMutex); waitForIOActivity.wait_for(lock, maxWait); + Discord_UpdateConnection(); } }); } diff --git a/Externals/licenses.md b/Externals/licenses.md index 9b8bab7341..d7dadbc3d0 100644 --- a/Externals/licenses.md +++ b/Externals/licenses.md @@ -8,6 +8,8 @@ Dolphin includes or links code of the following third-party software projects: [LGPLv2.1+](http://bochs.sourceforge.net/cgi-bin/lxr/source/COPYING) - [cubeb](https://github.com/kinetiknz/cubeb): [ISC](https://github.com/kinetiknz/cubeb/blob/master/LICENSE) +- [Discord-RPC](https://github.com/discordapp/discord-rpc): + [MIT](https://github.com/discordapp/discord-rpc/blob/master/LICENSE) - [ENet](http://enet.bespin.org/): [MIT](http://enet.bespin.org/License.html) - [GCEmu](http://sourceforge.net/projects/gcemu-project/): diff --git a/Source/Core/UICommon/UICommon.vcxproj b/Source/Core/UICommon/UICommon.vcxproj index 4c5459be03..9f7158e97c 100644 --- a/Source/Core/UICommon/UICommon.vcxproj +++ b/Source/Core/UICommon/UICommon.vcxproj @@ -45,7 +45,7 @@ {2c0d058e-de35-4471-ad99-e68a2caf9e18} - + {4482FD2A-EC43-3FFB-AC20-2E5C54B05EAD} diff --git a/Source/UnitTests/UnitTests.vcxproj b/Source/UnitTests/UnitTests.vcxproj index 24e814d773..d356803905 100644 --- a/Source/UnitTests/UnitTests.vcxproj +++ b/Source/UnitTests/UnitTests.vcxproj @@ -45,8 +45,8 @@ The following libs are needed since we pull in pretty much the entire dolphin codebase. --> - $(ExternalsDir)ffmpeg\lib;$(IntDir)..\discord-rpc\bin;%(AdditionalLibraryDirectories) - avrt.lib;iphlpapi.lib;winmm.lib;setupapi.lib;opengl32.lib;glu32.lib;rpcrt4.lib;comctl32.lib;avcodec.lib;avformat.lib;avutil.lib;swresample.lib;swscale.lib;Shlwapi.lib;discord-rpc.lib;%(AdditionalDependencies) + $(ExternalsDir)ffmpeg\lib;%(AdditionalLibraryDirectories) + avrt.lib;iphlpapi.lib;winmm.lib;setupapi.lib;opengl32.lib;glu32.lib;rpcrt4.lib;comctl32.lib;avcodec.lib;avformat.lib;avutil.lib;swresample.lib;swscale.lib;Shlwapi.lib;%(AdditionalDependencies) Console diff --git a/Source/VSProps/Base.props b/Source/VSProps/Base.props index 5b421cf5df..568d1d28b2 100644 --- a/Source/VSProps/Base.props +++ b/Source/VSProps/Base.props @@ -59,7 +59,7 @@ _M_X86=1;%(PreprocessorDefinitions) SFML_STATIC;%(PreprocessorDefinitions) USE_ANALYTICS=1;%(PreprocessorDefinitions) - USE_DISCORD_PRESENCE;%(PreprocessorDefinitions) + USE_DISCORD_PRESENCE;%(PreprocessorDefinitions) CURL_STATICLIB;%(PreprocessorDefinitions) _ARCH_64=1;_M_X86_64=1;%(PreprocessorDefinitions)