public void Dispose() { if (_disposeToken.TryMarkDisposed()) { _textBuffer?.RemoveService(this); } }
public void Dispose() { if (_disposeToken.TryMarkDisposed()) { ServiceManager.RemoveService <SignatureHelpSource>(_textBuffer); } }
protected virtual void Dispose(bool disposing) { _diagnosticsService?.Remove(Uri); _disposeToken.TryMarkDisposed(); var analyzer = Services.GetService <IPythonAnalyzer>(); analyzer.RemoveAnalysis(this); }
public override Task DisposeAsync(RunSummary result, IMessageBus messageBus) { if (!_disposeToken.TryMarkDisposed()) { return(Task.CompletedTask); } _compositionContainer.Dispose(); return(base.DisposeAsync(result, messageBus)); }
public void Dispose() { if (!_disposeToken.TryMarkDisposed()) { return; } _host?.Dispose(); Disposed?.Invoke(this, EventArgs.Empty); _onDispose(); }
public void Dispose() { if (!_disposeToken.TryMarkDisposed()) { return; } foreach (var session in _sessions.Values) { session.Dispose(); } }
public void Dispose() { if (_disposeToken.TryMarkDisposed()) { //foreach (var service in _s.Values) { // if (service is Lazy<object> lazy && lazy.IsValueCreated) { // (lazy.Value as IDisposable)?.Dispose(); // } else { // (service as IDisposable)?.Dispose(); // } //} } }
public void Dispose() { if (!_disposeToken.TryMarkDisposed()) { return; } if (_rSession != null) { _rSession.Mutated -= RSession_Mutated; _rSession = null; } }
public void Dispose() { if (_disposeToken.TryMarkDisposed()) { foreach (var service in _s.Values) { var lazy = service as Lazy <object>; if (lazy != null && lazy.IsValueCreated) { (lazy.Value as IDisposable)?.Dispose(); } else { (service as IDisposable)?.Dispose(); } } } }
public void Dispose() { if (!_disposeToken.TryMarkDisposed()) { return; } var sessions = GetSessions().ToList(); var stopHostTasks = sessions.Select(session => session.StopHostAsync(false)); try { _services.Tasks().Wait(Task.WhenAll(stopHostTasks)); } catch (Exception ex) when(!ex.IsCriticalException()) { } foreach (var session in sessions) { session.Dispose(); } Broker.Dispose(); }
public void Dispose() { _progress.Dispose(); _disposeToken.TryMarkDisposed(); }
protected virtual void Dispose(bool disposing) { _diagnosticsService?.Remove(Uri); _disposeToken.TryMarkDisposed(); }
public void Dispose() => _disposeToken.TryMarkDisposed();
public void TryMarkDisposed() { _disposeToken.IsDisposed.Should().BeFalse(); _disposeToken.TryMarkDisposed().Should().BeTrue(); _disposeToken.IsDisposed.Should().BeTrue(); }