From 6774b5d881e42aca835f51764e7106023a759b4a Mon Sep 17 00:00:00 2001 From: Chris Marsh Date: Fri, 28 Jul 2017 09:45:53 -0700 Subject: [PATCH] Only queue messages when connected. --- src/discord-rpc.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/discord-rpc.cpp b/src/discord-rpc.cpp index 3c5e4e2..a91123f 100644 --- a/src/discord-rpc.cpp +++ b/src/discord-rpc.cpp @@ -60,6 +60,11 @@ static void UpdateReconnectTime() static QueuedMessage* SendQueueGetNextAddMessage() { + // if we are not connected, let's not batch up stale messages for later + if (!Connection || !Connection->IsOpen()) { + return nullptr; + } + // if we are falling behind, bail if (SendQueuePendingSends.load() >= MessageQueueSize) { return nullptr;