[fpc-pascal] heaptrc unit troubles with New() & Dispose() calls
Graeme Geldenhuys
mailinglists at geldenhuys.co.uk
Sun Dec 13 22:50:09 CET 2020
Hi,
Are there any known issues with heaptrc unit via compiler parameters
-gl -gh, when using New() and Dispose() to manually allocate and free
memory.
I helped someone debug their code, finding and fixing a memory leaks, but
the FPC memory leak output, after the application terminates, did not mention
the actual method causing the memory leak. I used FPC 3.2 and the other
person used FPC 3.0 - both under Linux for x86_64.
The method that had the memory leak was using New() and Dispose() for memory
management. There was a try..except block and the exception block forgot to
call Dispose() on the variable that was allocated.
Normally FPC is pretty good at pinpointing where a memory leak was caused,
so I was just curious why it didn't work so well this time round.
Regards,
Graeme
More information about the fpc-pascal
mailing list