mirror of
https://github.com/aljazceru/signal-cli.git
synced 2025-12-27 02:54:23 +01:00
Fix removeReceiveHandler to not incorrectly reset the receiveThread
This commit is contained in:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user