mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-04-06 00:47:52 +02:00
* patch by Joeny Ang: fix TDbf memory leak, resolves #40709
This commit is contained in:
parent
14d4b0808b
commit
961e8fb749
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user