Пример #1
0
        public override void Dispose()
        {
            try
            {
                _directory.ResetAllocations();
                if (_hasSuggestions)
                {
                    foreach (var suggestionIndexWriter in _suggestionsWriters)
                    {
                        suggestionIndexWriter.Value.ResetAllocations();
                    }
                }

                _releaseWriteTransaction?.Dispose();
            }
            finally
            {
                _locker?.Release();
                _analyzer?.Dispose();

                if (_buffer != null)
                {
                    ArrayPool <byte> .Shared.Return(_buffer);

                    _buffer = null;
                }
            }
        }
Пример #2
0
 public override void Dispose()
 {
     _analyzer?.Dispose();
     _releaseSearcher?.Dispose();
     _releaseReadTransaction?.Dispose();
 }