mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-19 05:19:25 +02:00
LCL: wrap AppProcessMessage in ShowModal in try .. except block to catch exceptions in event handlers like is done for Application.Run too (fixes #7207)
git-svn-id: trunk@10398 -
This commit is contained in:
parent
5047d80931
commit
71de954bd0
@ -869,7 +869,7 @@ begin
|
||||
DebugLn('TApplication.HandleException: ',
|
||||
'there was another exception during showing the first exception');
|
||||
HaltingProgram:=true;
|
||||
//DumpExceptionBackTrace;
|
||||
DumpExceptionBackTrace;
|
||||
Halt;
|
||||
end;
|
||||
Include(FFlags,AppHandlingException);
|
||||
|
@ -1894,7 +1894,11 @@ begin
|
||||
which will wait for new messages. Under Win32 there is always a next
|
||||
message, so it works there. The LCL is OS independent, and so it uses
|
||||
a better way: }
|
||||
WidgetSet.AppProcessMessages; // process all events
|
||||
try
|
||||
WidgetSet.AppProcessMessages; // process all events
|
||||
except
|
||||
on E: Exception do Application.HandleException(E);
|
||||
end;
|
||||
if Application.Terminated then
|
||||
ModalResult := mrCancel;
|
||||
if ModalResult <> 0 then begin
|
||||
|
Loading…
Reference in New Issue
Block a user