From 020bdd07f21e8a4b2e1604abe6401cb407e5a382 Mon Sep 17 00:00:00 2001 From: Ansgar Becker Date: Fri, 29 Jan 2010 20:38:04 +0000 Subject: [PATCH] Suppress access violation caused by VCL bug. Fixes issue #1622. --- source/main.pas | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/source/main.pas b/source/main.pas index b8867331..07b52054 100644 --- a/source/main.pas +++ b/source/main.pas @@ -1392,6 +1392,7 @@ var Connected, DecideForStatistic: Boolean; StatsCall: TDownloadUrl2; SessionNames: TStringlist; + DlgResult: TModalResult; begin DefaultLastrunDate := '2000-01-01'; @@ -1499,7 +1500,14 @@ begin // Cannot be done in OnCreate because we need ready forms here: if not Assigned(SessionManager) then SessionManager := TConnForm.Create(Self); - if SessionManager.ShowModal = mrCancel then begin + DlgResult := mrCancel; + try + DlgResult := SessionManager.ShowModal; + except + // Work around VCL bug: Suppress access violation in TCustomForm.IsFormSizeStored + // when closing dialog via Alt+F4 + end; + if DlgResult = mrCancel then begin Free; Exit; end;