fix bug with reference closing that I swore we fixed

This commit is contained in:
fjy 2014-03-27 17:55:03 -07:00
parent aae8f4cf3c
commit cb1798c520
1 changed files with 4 additions and 1 deletions

View File

@ -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<T> extends YieldingSequenceBase<T>
@ -43,6 +45,7 @@ public class ReferenceCountingSequence<T> extends YieldingSequenceBase<T>
OutType initValue, YieldingAccumulator<OutType, T> accumulator
)
{
return new ResourceClosingYielder<OutType>(baseSequence.toYielder(initValue, accumulator), segment.increment());
Closeable closeable = segment.increment();
return new ResourceClosingYielder<OutType>(baseSequence.toYielder(initValue, accumulator), closeable);
}
}