mirror of
https://github.com/LorisYounger/VPet.git
synced 2024-08-30 18:42:36 +00:00
强退时不报错
This commit is contained in:
parent
802263e693
commit
cb200e0d84
@ -165,38 +165,45 @@ namespace VPet_Simulator.Windows
|
||||
}
|
||||
private void Exit()
|
||||
{
|
||||
if (IsSteamUser)
|
||||
SteamClient.Shutdown();//关掉和Steam的连线
|
||||
if (Core != null)
|
||||
try
|
||||
{
|
||||
foreach (var igs in Core.Graph.GraphsList.Values)
|
||||
if (IsSteamUser)
|
||||
SteamClient.Shutdown();//关掉和Steam的连线
|
||||
if (Core != null)
|
||||
{
|
||||
foreach (var ig2 in igs.Values)
|
||||
foreach (var igs in Core.Graph.GraphsList.Values)
|
||||
{
|
||||
foreach (var ig3 in ig2)
|
||||
foreach (var ig2 in igs.Values)
|
||||
{
|
||||
ig3.Stop();
|
||||
foreach (var ig3 in ig2)
|
||||
{
|
||||
ig3.Stop();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
if (Main != null)
|
||||
{
|
||||
Main.Dispose();
|
||||
}
|
||||
if (winSetting != null)
|
||||
{
|
||||
winSetting.Close();
|
||||
}
|
||||
AutoSaveTimer?.Stop();
|
||||
MusicTimer?.Stop();
|
||||
petHelper?.Close();
|
||||
if (notifyIcon != null)
|
||||
{
|
||||
notifyIcon.Visible = false;
|
||||
notifyIcon.Dispose();
|
||||
}
|
||||
notifyIcon?.Dispose();
|
||||
}
|
||||
if (Main != null)
|
||||
finally
|
||||
{
|
||||
Main.Dispose();
|
||||
Environment.Exit(0);
|
||||
}
|
||||
if (winSetting != null)
|
||||
{
|
||||
winSetting.Close();
|
||||
}
|
||||
AutoSaveTimer?.Stop();
|
||||
MusicTimer?.Stop();
|
||||
petHelper?.Close();
|
||||
if (notifyIcon != null)
|
||||
{
|
||||
notifyIcon.Visible = false;
|
||||
notifyIcon.Dispose();
|
||||
}
|
||||
notifyIcon?.Dispose();
|
||||
while (true)
|
||||
Environment.Exit(0);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user