Re: [fpc-pascal] FPC Debug line numbers

2017-11-07 Thread el es
On 06/11/17 21:49, James Richters wrote: > I've noticed that line numbers are sometimes off, sometimes quite a > bit when I receive a run-time error. I had one today, it specified > the correct function that was responsible for generating the error, > however the line number was way off, it

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

2017-11-07 Thread African Wild Dog
Hello, Using ReadXMLFile function from XMLRead unit generates memory leaks when trying to read a invalid XML content. CODE program xml_leak_test; uses heaptrc, Classes, DOM, XMLRead; var XMLDocument: TXMLDocument; InvalidStream: TStringStream; const INVALID_XML_CONTENT

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 =

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] FPC Debug line numbers

2017-11-07 Thread James Richters
>Didn't the unit have any include file? My doesn't have any include files. It's just a collection of procedure and functions that I use in many different programs.. but the unit also uses a lot of other units, some are more of my own, others are standard FPC units. >I vaguely recall reading

Re: [fpc-pascal] FPC Debug line numbers

2017-11-07 Thread Adriaan van Os
James Richters wrote: I've noticed that line numbers are sometimes off, sometimes quite a bit when I receive a run-time error. I had one today, it specified the correct function that was responsible for generating the error, however the line number was way off, it reported line 1463 but