Example #1
0
        private void Dispose(bool disposing)
        {
            if (_disposed)
            {
                return;
            }

            if (disposing)
            {
                if (_dnsRequestHandlers != null)
                {
                    foreach (IDnsApplicationRequestHandler handler in _dnsRequestHandlers.Values)
                    {
                        handler.Dispose();
                    }

                    _dnsRequestHandlers.Clear();
                }

                if (_appContext != null)
                {
                    _appContext.Unload();
                }
            }

            _disposed = true;
        }
        private void Dispose(bool disposing)
        {
            if (_disposed)
            {
                return;
            }

            if (disposing)
            {
                if (_dnsApplications is not null)
                {
                    foreach (KeyValuePair <string, IDnsApplication> app in _dnsApplications)
                    {
                        app.Value.Dispose();
                    }
                }

                if (_appContext != null)
                {
                    _appContext.Unload();
                }
            }

            _disposed = true;
        }