public void Dispose() { _diagnosticNotifier?.Dispose(); _server.Dispose(); _logger.Dispose(); }
public void Dispose() { lock (_disposeLock) { if (_disposed) { // Already disposed return; } _disposed = true; TempDirectory.Instance.Dispose(); _innerServer.Dispose(); // Disposing the server doesn't actually dispose the servers Services for whatever reason. We cast the services collection // to IDisposable and try to dispose it ourselves to account for this. var disposableServices = _innerServer.Services as IDisposable; disposableServices?.Dispose(); } }