From 65cae13b1e1be3a81ede37a4847cbc49841faef0 Mon Sep 17 00:00:00 2001 From: Joakim Erdfelt Date: Mon, 22 Sep 2014 11:18:30 -0700 Subject: [PATCH] 444748 - WebSocketClient.stop() does not unregister from ShutdownThread + Making (de)register smart about if wsclient is registered or not --- .../jetty/websocket/client/WebSocketClient.java | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/jetty-websocket/websocket-client/src/main/java/org/eclipse/jetty/websocket/client/WebSocketClient.java b/jetty-websocket/websocket-client/src/main/java/org/eclipse/jetty/websocket/client/WebSocketClient.java index 4a9a9816205..4e535bccf0b 100644 --- a/jetty-websocket/websocket-client/src/main/java/org/eclipse/jetty/websocket/client/WebSocketClient.java +++ b/jetty-websocket/websocket-client/src/main/java/org/eclipse/jetty/websocket/client/WebSocketClient.java @@ -264,6 +264,11 @@ public class WebSocketClient extends ContainerLifeCycle implements SessionListen { if (LOG.isDebugEnabled()) LOG.debug("Stopping {}",this); + + if (ShutdownThread.isRegistered(this)) + { + ShutdownThread.deregister(this); + } if (cookieStore != null) { @@ -435,7 +440,10 @@ public class WebSocketClient extends ContainerLifeCycle implements SessionListen private synchronized void initialiseClient() throws IOException { - ShutdownThread.register(this); + if (!ShutdownThread.isRegistered(this)) + { + ShutdownThread.register(this); + } if (executor == null) {