Fix removeReceiveHandler to not incorrectly reset the receiveThread
This commit is contained in:
parent
5dd602614c
commit
e495afcff5
@ -956,12 +956,12 @@ public class ManagerImpl implements Manager {
|
|||||||
public void removeReceiveHandler(final ReceiveMessageHandler handler) {
|
public void removeReceiveHandler(final ReceiveMessageHandler handler) {
|
||||||
final Thread thread;
|
final Thread thread;
|
||||||
synchronized (messageHandlers) {
|
synchronized (messageHandlers) {
|
||||||
thread = receiveThread;
|
|
||||||
receiveThread = null;
|
|
||||||
messageHandlers.remove(handler);
|
messageHandlers.remove(handler);
|
||||||
if (!messageHandlers.isEmpty() || isReceivingSynchronous) {
|
if (!messageHandlers.isEmpty() || isReceivingSynchronous) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
thread = receiveThread;
|
||||||
|
receiveThread = null;
|
||||||
}
|
}
|
||||||
|
|
||||||
stopReceiveThread(thread);
|
stopReceiveThread(thread);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user