简体   繁体   中英

memoryleak (node) in IXMLDocument AddChild

Apparently there is a memory leak in this code:

procedure TForm1.Button1Click(Sender: TObject);
var
  doc: IXMLDocument;
begin
  doc := TXMLDocument.Create(Nil);
  doc.Active := True;
  doc.AddChild('test');
  doc := Nil;
end; 

Clicking on the button gives me a report of a memory leak. Is this a false positive or is there a leak? IDE is Rad Studio 10.2

I contacted Eurekalog support: it was a false positive of a RESOURCE leak (not a memory leak as my title says). Eurekalog did not report a memory leak but a resource leak,sorry for the confusion and thanks for the help (especially the suggestion of a false positive).

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM