TSQLConnection.DoInternalDisconnect: safe with Assigned(FStatements) - like TDatabase.CloseDataSets etc.

(cherry picked from commit 8bd9651abd)
This commit is contained in:
Ondrej Pokorny 2023-10-16 11:43:23 +02:00 committed by marcoonthegit
parent 7340e8b530
commit 2dd77e5a26

View File

@ -1473,14 +1473,17 @@ Var
L : TList;
begin
L:=FStatements.LockList;
try
For I:=0 to L.Count-1 do
TCustomSQLStatement(L[i]).Unprepare;
L.Clear;
finally
FStatements.UnlockList;
end;
If Assigned(FStatements) then
begin
L:=FStatements.LockList;
try
For I:=0 to L.Count-1 do
TCustomSQLStatement(L[i]).Unprepare;
L.Clear;
finally
FStatements.UnlockList;
end;
end;
end;
procedure TSQLConnection.StartTransaction;