From cab78358056c32beeedf2343288c5e3568dcfa7a Mon Sep 17 00:00:00 2001 From: Peter Lawrey Date: Fri, 2 Oct 2020 12:42:47 +0100 Subject: [PATCH] Unmonitor the segmentBytes in a Map's QueryContext, closes https://github.com/OpenHFT/Chronicle-Map/issues/232 --- .../java/net/openhft/chronicle/map/VanillaChronicleMap.java | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/main/java/net/openhft/chronicle/map/VanillaChronicleMap.java b/src/main/java/net/openhft/chronicle/map/VanillaChronicleMap.java index 21afbe74c..7e8ca65bf 100755 --- a/src/main/java/net/openhft/chronicle/map/VanillaChronicleMap.java +++ b/src/main/java/net/openhft/chronicle/map/VanillaChronicleMap.java @@ -22,6 +22,7 @@ import net.openhft.chronicle.bytes.Bytes; import net.openhft.chronicle.bytes.BytesStore; import net.openhft.chronicle.bytes.PointerBytesStore; import net.openhft.chronicle.core.Jvm; +import net.openhft.chronicle.core.io.AbstractReferenceCounted; import net.openhft.chronicle.hash.ChronicleHashClosedException; import net.openhft.chronicle.hash.ChronicleHashCorruption; import net.openhft.chronicle.hash.Data; @@ -417,7 +418,9 @@ public class VanillaChronicleMap } ChainingInterface newQueryContext() { - return new CompiledMapQueryContext<>(this); + CompiledMapQueryContext context = new CompiledMapQueryContext<>(this); + AbstractReferenceCounted.unmonitor(context.segmentBytes); + return context; } public QueryContextInterface mapContext() {