From cb1798c5204c2603f8ee8bcd6c074723c867647c Mon Sep 17 00:00:00 2001 From: fjy Date: Thu, 27 Mar 2014 17:55:03 -0700 Subject: [PATCH] fix bug with reference closing that I swore we fixed --- .../java/io/druid/segment/ReferenceCountingSequence.java | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/processing/src/main/java/io/druid/segment/ReferenceCountingSequence.java b/processing/src/main/java/io/druid/segment/ReferenceCountingSequence.java index 2f51e4ddc10..105365b9dd6 100644 --- a/processing/src/main/java/io/druid/segment/ReferenceCountingSequence.java +++ b/processing/src/main/java/io/druid/segment/ReferenceCountingSequence.java @@ -25,6 +25,8 @@ import com.metamx.common.guava.Yielder; import com.metamx.common.guava.YieldingAccumulator; import com.metamx.common.guava.YieldingSequenceBase; +import java.io.Closeable; + /** */ public class ReferenceCountingSequence extends YieldingSequenceBase @@ -43,6 +45,7 @@ public class ReferenceCountingSequence extends YieldingSequenceBase OutType initValue, YieldingAccumulator accumulator ) { - return new ResourceClosingYielder(baseSequence.toYielder(initValue, accumulator), segment.increment()); + Closeable closeable = segment.increment(); + return new ResourceClosingYielder(baseSequence.toYielder(initValue, accumulator), closeable); } } \ No newline at end of file