From e495afcff5f20cc2207bddac4923d015263f3e36 Mon Sep 17 00:00:00 2001 From: AsamK Date: Mon, 8 Nov 2021 14:43:57 +0100 Subject: [PATCH] Fix removeReceiveHandler to not incorrectly reset the receiveThread --- lib/src/main/java/org/asamk/signal/manager/ManagerImpl.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/src/main/java/org/asamk/signal/manager/ManagerImpl.java b/lib/src/main/java/org/asamk/signal/manager/ManagerImpl.java index 5ee2e7d3..9e81f206 100644 --- a/lib/src/main/java/org/asamk/signal/manager/ManagerImpl.java +++ b/lib/src/main/java/org/asamk/signal/manager/ManagerImpl.java @@ -956,12 +956,12 @@ public class ManagerImpl implements Manager { public void removeReceiveHandler(final ReceiveMessageHandler handler) { final Thread thread; synchronized (messageHandlers) { - thread = receiveThread; - receiveThread = null; messageHandlers.remove(handler); if (!messageHandlers.isEmpty() || isReceivingSynchronous) { return; } + thread = receiveThread; + receiveThread = null; } stopReceiveThread(thread);