private void InvokeShutdown()
        {
            if (_ShutdownInvoked)
            {
                return;
            }

            if (_StartupModules is object)
            {
                _ShutdownInvoked = true;

                foreach (var module in _StartupModules)
                {
                    try
                    {
                        module?.Shutdown();
                    }
                    catch (Exception ex)
                    {
                        _StartupConfiguration.Logger.
                        LogException($"Failed to shutdown module {module.GetType().FullName}!", ex, typeof(ShutdownHandler), LogLevel.Error);
                    }
                }

                // Dispose root locator and backing container
                if (DisposeLocator)
                {
                    _Locator.Dispose();
                }
            }
        }
 /// <summary>
 /// Dispose a scoped locator
 /// </summary>
 public void Dispose()
 {
     _Locator?.Dispose();
 }
Example #3
0
 public void Dispose()
 {
     locator.Dispose();
 }