LUCENE-3125: SegmentMerger was closing in-use DocValues after merge

git-svn-id: https://svn.apache.org/repos/asf/lucene/dev/branches/docvalues@1125108 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Simon Willnauer 2011-05-19 21:12:54 +00:00
parent a19d849e2f
commit 5b7793da51
1 changed files with 1 additions and 4 deletions

View File

@ -575,15 +575,12 @@ final class SegmentMerger {
mergeState.multiDeletedDocs = new MultiBits(perDocBits, perDocBitsStarts); mergeState.multiDeletedDocs = new MultiBits(perDocBits, perDocBitsStarts);
final PerDocConsumer docsConsumer = codec final PerDocConsumer docsConsumer = codec
.docsConsumer(new PerDocWriteState(segmentWriteState)); .docsConsumer(new PerDocWriteState(segmentWriteState));
MultiPerDocValues multiPerDocValues = null;
try { try {
multiPerDocValues = new MultiPerDocValues(perDocProducers final MultiPerDocValues multiPerDocValues = new MultiPerDocValues(perDocProducers
.toArray(PerDocValues.EMPTY_ARRAY), perDocSlices .toArray(PerDocValues.EMPTY_ARRAY), perDocSlices
.toArray(ReaderUtil.Slice.EMPTY_ARRAY)); .toArray(ReaderUtil.Slice.EMPTY_ARRAY));
docsConsumer.merge(mergeState, multiPerDocValues); docsConsumer.merge(mergeState, multiPerDocValues);
} finally { } finally {
if (multiPerDocValues != null)
multiPerDocValues.close();
docsConsumer.close(); docsConsumer.close();
} }
} }