Properly remove the plugin window from the lists in the main window when an exception occurs

This commit is contained in:
Stone_Red
2025-02-26 20:22:42 +01:00
parent 088f51410a
commit 2df00fbeeb
+6
View File
@@ -245,8 +245,14 @@ namespace DesktopMagic
window.PluginLoaded -= onPluginLoaded; window.PluginLoaded -= onPluginLoaded;
}); });
}; };
window.OnExit += () => window.OnExit += () =>
{ {
Windows.Remove(window);
WindowNames.Remove(window.Title);
blockWindowsClosing = false;
window.Close();
blockWindowsClosing = true;
pluginSettings.Enabled = false; pluginSettings.Enabled = false;
}; };
window.PluginLoaded += onPluginLoaded; window.PluginLoaded += onPluginLoaded;