diff --git a/ShareX/Forms/MainForm.cs b/ShareX/Forms/MainForm.cs index aacba2630..8b68c8b63 100644 --- a/ShareX/Forms/MainForm.cs +++ b/ShareX/Forms/MainForm.cs @@ -302,7 +302,7 @@ protected override void WndProc(ref Message m) { if (m.Msg == (int)WindowsMessages.QUERYENDSESSION) { - var reason = (EndSessionReasons)m.LParam; + EndSessionReasons reason = (EndSessionReasons)m.LParam; if (reason.HasFlag(EndSessionReasons.ENDSESSION_CLOSEAPP)) { // Register for restart. This allows our application to automatically restart when it is installing an update from the Store. @@ -318,8 +318,7 @@ protected override void WndProc(ref Message m) { // If wParam is not equal to false (0), the application can be terminated at any moment after processing this message // thus should save its data while processing the message. - SettingManager.SaveAllSettings(); - // CloseSequence(); + Program.CloseSequence(); } m.Result = IntPtr.Zero; // "If an application processes this message, it should return zero." }