* patch by Joeny Ang: fix TDbf memory leak, resolves #40709

This commit is contained in:
florian 2024-03-26 15:02:29 +01:00
parent 14d4b0808b
commit 961e8fb749

View File

@ -1258,15 +1258,16 @@ var
begin
MustReleaseDbfFile := false;
with FieldDefs do
begin
try
if FDbfFile = nil then
begin
MustReleaseDbfFile := true;
// do not AutoCreate file
InitDbfFile(pfReadOnly);
FDbfFile.Open;
MustReleaseDbfFile := true;
end;
GetFieldDefsFromDbfFieldDefs;
finally
if MustReleaseDbfFile then
FreeAndNil(FDbfFile);
end;