Safety check if PMYSQL handle is assigned in Ping() method. Tries to fix a sporadic access violation, unreproducible here but reported here: http://www.heidisql.com/forum.php?t=4694

This commit is contained in:
Ansgar Becker
2010-01-07 07:02:18 +00:00
parent a4652d39a4
commit 49b06f41b7

View File

@ -352,7 +352,7 @@ end;
function TMySQLConnection.Ping: Boolean;
begin
if FActive and (mysql_ping(FHandle) <> 0) then begin
if FActive and ((FHandle=nil) or (mysql_ping(FHandle) <> 0)) then begin
Active := False;
ClearCache;
end;