protected internal override void DoClose()
{
lock (this)
{
System.IO.IOException ioe = null;
normsCache = null;
foreach (SegmentReader t in subReaders)
{
// try to close each reader, even if an exception is thrown
try
{
t.DecRef();
}
catch (System.IO.IOException e)
{
if (ioe == null)
ioe = e;
}
}
// NOTE: only needed in case someone had asked for
// FieldCache for top-level reader (which is generally
// not a good idea):
Search.FieldCache_Fields.DEFAULT.Purge(this);
// throw the first exception
if (ioe != null)
throw ioe;
}
}