diff options
Diffstat (limited to 'src/SMAPI/Framework/SCore.cs')
-rw-r--r-- | src/SMAPI/Framework/SCore.cs | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/src/SMAPI/Framework/SCore.cs b/src/SMAPI/Framework/SCore.cs index e64c2801..e2a9463b 100644 --- a/src/SMAPI/Framework/SCore.cs +++ b/src/SMAPI/Framework/SCore.cs @@ -278,15 +278,16 @@ namespace StardewModdingAPI.Framework ); // add exit handler - new Thread(() => + this.CancellationToken.Token.Register(() => { - this.CancellationToken.Token.WaitHandle.WaitOne(); if (this.IsGameRunning) { + this.inputThread.Abort(); this.LogManager.WriteCrashLog(); this.Game.Exit(); } - }).Start(); + }); + // set window titles this.SetWindowTitles( |