summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/gui/gui_form.pas8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/gui/gui_form.pas b/src/gui/gui_form.pas
index 4ac0ac63..69e1470a 100644
--- a/src/gui/gui_form.pas
+++ b/src/gui/gui_form.pas
@@ -236,6 +236,8 @@ begin
end;
function TfpgForm.ShowModal: integer;
+var
+ CloseAction: TCloseAction;
begin
FWindowType := wtModalForm;
fpgApplication.PushModalForm(self);
@@ -256,6 +258,12 @@ begin
fpgApplication.PopModalForm;
Result := ModalResult;
+
+ if ModalResult <> 0 then
+ begin
+ CloseAction := caFree; // Dummy variable - we do nothing with it
+ DoOnClose(CloseAction); // Simply so the OnClose event fires.
+ end;
end;
procedure TfpgForm.MsgClose(var msg: TfpgMessageRec);