mirror of
https://github.com/ShareX/ShareX.git
synced 2024-10-04 04:06:05 +13:00
Merge pull request #3760 from sylveon/master
Fix crashes when starting and closing
This commit is contained in:
commit
56b14102ff
2 changed files with 2 additions and 2 deletions
|
@ -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.
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue