mirror of
https://github.com/MCCTeam/Minecraft-Console-Client
synced 2026-08-15 13:04:36 +00:00
Add ability to perform clean-up code before quitting (#1561)
* Add ability to perform clean-up code before quitting * Move to WinAPI namespace
This commit is contained in:
parent
750684e010
commit
0400ad89ac
3 changed files with 105 additions and 0 deletions
|
|
@ -150,6 +150,15 @@ namespace MinecraftClient
|
|||
{
|
||||
RequestPassword();
|
||||
}
|
||||
|
||||
// Setup exit cleaning code
|
||||
ExitCleanUp.Add(delegate ()
|
||||
{
|
||||
// Do NOT use Program.Exit() as creating new Thread cause program to freeze
|
||||
if (client != null) { client.Disconnect(); ConsoleIO.Reset(); }
|
||||
if (offlinePrompt != null) { offlinePrompt.Abort(); offlinePrompt = null; ConsoleIO.Reset(); }
|
||||
if (Settings.playerHeadAsIcon) { ConsoleIcon.revertToMCCIcon(); }
|
||||
});
|
||||
|
||||
|
||||
startupargs = args;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue