summaryrefslogtreecommitdiff
path: root/src/corelib/gfxbase.pas
diff options
context:
space:
mode:
Diffstat (limited to 'src/corelib/gfxbase.pas')
-rw-r--r--src/corelib/gfxbase.pas6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/corelib/gfxbase.pas b/src/corelib/gfxbase.pas
index 03aae37d..6e419d72 100644
--- a/src/corelib/gfxbase.pas
+++ b/src/corelib/gfxbase.pas
@@ -1938,7 +1938,13 @@ begin
end;
procedure TfpgApplicationBase.Terminate;
+var
+ i: integer;
begin
+ // make sure all forms are closed before main form
+ for i := FormCount - 1 downto 0 do
+ if Forms[i] <> MainForm then
+ fpgSendMessage(Self, Forms[i], FPGM_CLOSE); // SendMessage waits for it to complete. Post doesn't.
Terminated := True;
end;