Fix AV after cancelling connection dialog

This commit is contained in:
Ansgar Becker
2009-01-01 23:34:00 +00:00
parent f1b3f5501f
commit 9074d5b7ca

View File

@@ -1175,8 +1175,10 @@ begin
SetLength(FQueryGridResult.Columns, 0);
// Closing connection
FMysqlConn.Disconnect;
FreeAndNil(FMysqlConn);
if Assigned(FMysqlConn) then begin
FMysqlConn.Disconnect;
FreeAndNil(FMysqlConn);
end;
EnterCriticalSection(SqlMessagesLock);
FreeAndNil(SqlMessages);