Suppress access violation caused by VCL bug. Fixes issue #1622.

This commit is contained in:
Ansgar Becker
2010-01-29 20:38:04 +00:00
parent 881df6bf0b
commit 020bdd07f2

View File

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