Ejemplo n.º 1
0
 /// <summary> Closes the underlying <see cref="Lucene.Net.Store.IndexInput" /> streams, including any ones associated with a
 /// lazy implementation of a Field.  This means that the Fields values will not be accessible.
 ///
 /// </summary>
 /// <throws>  IOException </throws>
 public void Dispose()
 {
     // Move to protected method if class becomes unsealed
     if (!closed)
     {
         if (fieldsStream != null)
         {
             fieldsStream.Close();
         }
         if (isOriginal)
         {
             if (cloneableFieldsStream != null)
             {
                 cloneableFieldsStream.Close();
             }
             if (cloneableIndexStream != null)
             {
                 cloneableIndexStream.Close();
             }
         }
         if (indexStream != null)
         {
             indexStream.Close();
         }
         fieldsStreamTL.Close();
         closed = true;
     }
 }
Ejemplo n.º 2
0
 internal void  Close()
 {
     if (origEnum != null)
     {
         origEnum.Close();
     }
     threadResources.Close();
 }
Ejemplo n.º 3
0
 /// <summary>
 ///     Frees persistent resources used by the <see cref="Analyzer"/>.
 /// </summary>
 /// <remarks>
 ///     <para>
 ///         The default implementation closes the internal <see cref="TokenStream"/>s
 ///         used by the analyzer.
 ///     </para>
 /// </remarks>
 public virtual void  Close()
 {
     if (tokenStreams != null)
     {
         tokenStreams.Close();
     }
     tokenStreams = null;
 }
Ejemplo n.º 4
0
        protected virtual void Dispose(bool disposing)
        {
            if (isDisposed)
            {
                return;
            }

            if (disposing)
            {
                if (tokenStreams != null)
                {
                    tokenStreams.Close();
                    tokenStreams = null;
                }
            }
            isDisposed = true;
        }