diff options
-rw-r--r-- | src/gui/gui_form.pas | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/src/gui/gui_form.pas b/src/gui/gui_form.pas index d4a1ec18..088a5b40 100644 --- a/src/gui/gui_form.pas +++ b/src/gui/gui_form.pas @@ -255,7 +255,12 @@ begin fpgWaitWindowMessage; until (ModalResult <> 0) or (not Visible); except - fpgApplication.HandleException(self); + on E: Exception do + begin + ModalResult := -1; + Visible := False; + fpgApplication.HandleException(self); + end; end; fpgApplication.PopModalForm; |