Disconnect from server must be the last thing to do in FormClose, as other (repaint) actions can implicitly trigger some database query. Fixes issue #1780.

This commit is contained in:
Ansgar Becker
2010-03-20 21:08:32 +00:00
parent b57153c956
commit 63557fe852

View File

@@ -1141,9 +1141,6 @@ begin
FreeAndNil(CreateDatabaseForm);
FreeAndNil(SearchReplaceDialog);
// Close database connection
DoDisconnect;
OpenRegistry;
// Position of Toolbars
MainReg.WriteInteger(REGNAME_TOOLBAR2LEFT, ToolBarStandard.Left);
@@ -1194,6 +1191,10 @@ begin
MainReg.CloseKey;
MainReg.Free;
end;
// Close database connection at the very end, otherwise above stuff can implicitely
// trigger some database query, e.g. DBtree.GetText
DoDisconnect;
end;