Hi, as a premise I would say that I'm an inexperienced programmer and have no idea if TDOMParser for XML validation can be used in a TTHread (if it's thread safe) but I tried and it worked..
So, i wrote this app (to be correct it's a daemon) inside there's an XML validation loop that does it's job every time there are new files available in an input queue;
although it was working, there was an increase of used memory at each cycle.
I checked twice everywhere for leaks and found none, it was really frustrating..
I rewrote the "XML validating loop" in an external test program and following exactly the wiki at
https://wiki.lazarus.freepascal.org/XML_Tutorial and also with this little app it was there was a leak..
As a "totally random try" I added a TheDoc.Free to the TXMLDocument (the one used for the Parser.Parse call) just after the "Parser Free", and to my great surprise, the leak disappeared!
Nowhere in the wiki in the "Validating a document" section it's mentioned to "free" the TXMLDocument, so I'm asking if it's needed or not and in that case if the wiki is incorrect..
Could someone of you pro guys give a look in this?
Also, coul I have advice about what i explained in the beginning of the post, as an inexperienced programmer I used this validation loop with TDomParser inside a thread, is it dangerous somehow?
Thank you
