Merge pull request #3760 from sylveon/master

Fix crashes when starting and closing
This commit is contained in:
Jaex 2018-11-16 22:19:13 +03:00 committed by GitHub
commit 56b14102ff
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 2 deletions

View file

@ -302,7 +302,7 @@ protected override void WndProc(ref Message m)
{
if (m.Msg == (int)WindowsMessages.QUERYENDSESSION)
{
EndSessionReasons reason = (EndSessionReasons)m.LParam;
EndSessionReasons reason = (EndSessionReasons)(m.LParam.ToInt64() & 0xFFFFFFFF);
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.

View file

@ -287,7 +287,7 @@ private static void Run()
SilentRun = CLI.IsCommandExist("silent", "s");
#if WindowsStore
SilentRun = SilentRun || AppInstance.GetActivatedEventArgs().Kind == ActivationKind.StartupTask;
SilentRun = SilentRun || AppInstance.GetActivatedEventArgs()?.Kind == ActivationKind.StartupTask;
#endif
#if STEAM