From 71de954bd06c07232aec1e29d1d51d421d5fd6e6 Mon Sep 17 00:00:00 2001 From: vincents Date: Mon, 8 Jan 2007 20:14:47 +0000 Subject: [PATCH] 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 - --- lcl/include/application.inc | 2 +- lcl/include/customform.inc | 6 +++++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/lcl/include/application.inc b/lcl/include/application.inc index 081dd8974b..8b36128059 100644 --- a/lcl/include/application.inc +++ b/lcl/include/application.inc @@ -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); diff --git a/lcl/include/customform.inc b/lcl/include/customform.inc index d51c5244a9..da29df03ac 100644 --- a/lcl/include/customform.inc +++ b/lcl/include/customform.inc @@ -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