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:
vincents 2007-01-08 20:14:47 +00:00
parent 5047d80931
commit 71de954bd0
2 changed files with 6 additions and 2 deletions

View File

@ -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);

View File

@ -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