Fix for null reference exception (#6589)

This commit is contained in:
Divyansh Srivastava
2020-09-14 11:03:17 -07:00
committed by GitHub
parent 3d5c790fb6
commit d75dd71848

View File

@@ -172,14 +172,18 @@ namespace PowerLauncher
{ {
Log.Info("|App.OnExit| Start PowerToys Run Exit---------------------------------------------------- "); Log.Info("|App.OnExit| Start PowerToys Run Exit---------------------------------------------------- ");
if (disposing) if (disposing)
{
if (_themeManager != null)
{ {
_themeManager.ThemeChanged -= OnThemeChanged; _themeManager.ThemeChanged -= OnThemeChanged;
API.SaveAppAllSettings(); }
API?.SaveAppAllSettings();
PluginManager.Dispose(); PluginManager.Dispose();
_mainWindow.Dispose(); _mainWindow?.Dispose();
API.Dispose(); API?.Dispose();
_mainVM.Dispose(); _mainVM?.Dispose();
_themeManager.Dispose(); _themeManager?.Dispose();
_disposed = true; _disposed = true;
} }