Shutdown app when main window closed

This commit is contained in:
Megalon 2020-06-01 19:25:35 -07:00
parent 425d96f83d
commit ef197d1611

View file

@ -95,6 +95,21 @@ namespace ModAssistant
}
}
/* Force the app to shutdown when The main window is closed.
*
* Explaination:
* OneClickStatus is initialized as a static object,
* so the window will exist, even if it is unused.
* This would cause Mod Assistant to not shutdown,
* because technically a window was still open.
*/
protected override void OnClosed(EventArgs e)
{
base.OnClosed(e);
Application.Current.Shutdown();
}
private async void LoadVersionsAsync()
{
try