From 2f57721f52278ca1c7b98b6a0cc9bc3c3db5918c Mon Sep 17 00:00:00 2001 From: Rob Austin Date: Fri, 19 Dec 2014 09:08:45 +0000 Subject: [PATCH] HCOLL-240 now setting clientChannel to NULL on close --- .../net/openhft/chronicle/map/StatelessChronicleMap.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/main/java/net/openhft/chronicle/map/StatelessChronicleMap.java b/src/main/java/net/openhft/chronicle/map/StatelessChronicleMap.java index 3566ac094..070611d1a 100644 --- a/src/main/java/net/openhft/chronicle/map/StatelessChronicleMap.java +++ b/src/main/java/net/openhft/chronicle/map/StatelessChronicleMap.java @@ -75,7 +75,7 @@ class StatelessChronicleMap implements ChronicleMap, Closeable, Clon private final ReaderWithSize valueReaderWithSize; @NotNull private final WriterWithSize valueWriterWithSize; - private volatile SocketChannel clientChannel; + private SocketChannel clientChannel; @Nullable private CloseablesManager closeables; @@ -309,11 +309,12 @@ class StatelessChronicleMap implements ChronicleMap, Closeable, Clon throw new UnsupportedOperationException(); } - public void close() { + public synchronized void close() { if (closeables != null) closeables.closeQuietly(); closeables = null; + clientChannel = null; }