Re: [fpc-pascal] Memory Leak's in XMLRead unit

2017-11-08 Thread Marcos Douglas B. Santos
On Wed, Nov 8, 2017 at 10:52 AM, African Wild Dog wrote: > 2017-11-07 23:57 GMT-02:00 Michael Van Canneyt : >> >> ... >> > My environment: Linux Debian Stretch 64 bits - Lazarus 1.6.4 - fpc 3.0.2. > > I'm quite impressed with the processing power

Re: [fpc-pascal] Memory Leak's in XMLRead unit

2017-11-08 Thread Michael Van Canneyt
On Wed, 8 Nov 2017, African Wild Dog wrote: 2017-11-07 23:57 GMT-02:00 Michael Van Canneyt : The "memory leak" is the exception object: you are not catching the exception. Change your program to the below, and you'll see that it is not leaking memory in the XML

Re: [fpc-pascal] Memory Leak's in XMLRead unit

2017-11-08 Thread African Wild Dog
2017-11-07 23:57 GMT-02:00 Michael Van Canneyt : > > The "memory leak" is the exception object: you are not catching the > exception. > > Change your program to the below, and you'll see that it is not leaking > memory in the XML routines itself. > > Michael. > In fact,

Re: [fpc-pascal] Memory Leak's in XMLRead unit

2017-11-07 Thread Michael Van Canneyt
On Tue, 7 Nov 2017, African Wild Dog wrote: Hello, Using ReadXMLFile function from XMLRead unit generates memory leaks when trying to read a invalid XML content. The "memory leak" is the exception object: you are not catching the exception. Change your program to the below, and you'll see

Re: [fpc-pascal] Memory Leak's in XMLRead unit

2017-11-07 Thread Vojtěch Čihák
Hi, if I run the code it writes "Unhandled exception". I tried to add another try..except block and it's OK.    program xml_leak_test; {$mode objfpc} uses   heaptrc,   Classes,   DOM,   XMLRead; var   XMLDocument: TXMLDocument;   InvalidStream: TStringStream;   const   INVALID_XML_CONTENT =