File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -426,7 +426,8 @@ bool ManualCheck
426426 // Check if the user has disabled updates
427427 if ( ! ManualCheck && Settings . Get ( Settings . K . DisableAutoUpdateWingetUI ) )
428428 {
429- Banner . IsOpen = false ;
429+ // Banner is a UI element; always touch it from the UI thread.
430+ Window . DispatcherQueue . TryEnqueue ( ( ) => Banner . IsOpen = false ) ;
430431 Logger . Warn ( "User disabled updates!" ) ;
431432 return true ;
432433 }
Original file line number Diff line number Diff line change @@ -135,11 +135,22 @@ static string GetExceptionData(Exception e)
135135 }
136136 }
137137
138+ // Run the integrity check on a background thread with a tight timeout.
139+ // Running it synchronously on the UI thread can block for 20-30 s on slow
140+ // disks, and calling Environment.Exit while the UI thread holds WinRT locks
141+ // causes a native crash in coreclr!ProcessCLRException (null read @ 0x0).
138142 string iReport ;
139143 try
140144 {
141- var integrityReport = IntegrityTester . CheckIntegrity ( false ) ;
142- iReport = IntegrityTester . GetReadableReport ( integrityReport ) ;
145+ var integrityTask = Task . Run ( ( ) => IntegrityTester . CheckIntegrity ( false ) ) ;
146+ if ( integrityTask . Wait ( TimeSpan . FromSeconds ( 5 ) ) )
147+ {
148+ iReport = IntegrityTester . GetReadableReport ( integrityTask . Result ) ;
149+ }
150+ else
151+ {
152+ iReport = "Integrity check timed out (> 5 s) — skipped in crash report" ;
153+ }
143154 }
144155 catch ( Exception ex )
145156 {
You can’t perform that action at this time.
0 commit comments