mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-08-30 21:00:30 +02:00
* free doc before calling a readxmlfile procedure routine with OUT parameter. Fixes #40126
(cherry picked from commit 8c888d9744
)
This commit is contained in:
parent
66bfb69e96
commit
3aa9e1dc62
@ -167,6 +167,7 @@ begin
|
||||
F:=TFileStream.Create(AFileName,fmOpenread or fmShareDenyWrite);
|
||||
try
|
||||
FFileName := '';
|
||||
Doc.Free;
|
||||
ReadXMLFile(Doc, AFilename);
|
||||
FFileName:=AFileName;
|
||||
finally
|
||||
@ -176,6 +177,7 @@ end;
|
||||
|
||||
procedure TXMLConfig.LoadFromStream(S: TStream);
|
||||
begin
|
||||
Doc.Free;
|
||||
ReadXMLFile(Doc,S);
|
||||
FModified := False;
|
||||
if (Doc.DocumentElement.NodeName<>FRootName) then
|
||||
|
Loading…
Reference in New Issue
Block a user