protected virtual void Dispose(bool disposing) { if (disposing) { if (TextBuffer != null) { if (Closing != null) { Closing(this, null); } if (TreeUpdateTask != null) { TreeUpdateTask.Dispose(); TreeUpdateTask = null; } if (TreeLock != null) { TreeLock.Dispose(); TreeLock = null; } TextBuffer.ChangedHighPriority -= OnTextBufferChanged; TextBuffer = null; } } }