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() {