示例#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.Dispose();
         closed = true;
     }
 }
示例#2
0
        public void Dispose()
        {
            if (isDisposed)
            {
                return;
            }

            // Move to protected method if class becomes unsealed
            if (origEnum != null)
            {
                origEnum.Dispose();
            }
            threadResources.Dispose();

            isDisposed = true;
        }
示例#3
0
        protected virtual void Dispose(bool disposing)
        {
            if (isDisposed)
            {
                return;
            }

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