Recent

Author Topic: HeapTrc wrong usage  (Read 2836 times)

avra

  • Hero Member
  • *****
  • Posts: 2514
    • Additional info
HeapTrc wrong usage
« on: February 10, 2016, 01:03:04 am »
I would like to share my example of wrong heaptrc usage...

After some hard debugging and troubleshooting I wanted to dig a little into heaptrc unit to see if there was anything more inside of it which I could have used along with TLogger. Therefore besides being the first unit in project, I have included it in one of my other units where I temporarily needed it.

What a wrong move!!!  >:(  :'( %)

In meantime I have solved my problem but completely forgotten to remove heaptrc from the uses in that other unit. Well, many, many man hours later I have figured out why my application had sudden leaks, hangs and freezes, and totally different errors with heaptrc used or not with a project. What a relief!

I wish IDE had at least warned me that I had heaptrc which was not the first used unit in a project, or that I had 2 such units.

Doc says only that it should be the first used unit in a project, but nothing said that it was dangerous to include it once more.

Cheers!
ct2laz - Conversion between Lazarus and CodeTyphon
bithelpers - Bit manipulation for standard types
pasettimino - Siemens S7 PLC lib

skalogryz

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 2770
    • havefunsoft.com
Re: HeapTrc wrong usage
« Reply #1 on: February 10, 2016, 04:11:19 am »
Doc says only that it should be the first used unit in a project, but nothing said that it was dangerous to include it once more.
It does now!

avra

  • Hero Member
  • *****
  • Posts: 2514
    • Additional info
Re: HeapTrc wrong usage
« Reply #2 on: February 10, 2016, 03:55:48 pm »
Doc says only that it should be the first used unit in a project, but nothing said that it was dangerous to include it once more.
It does now!
Thanks!
I couldn't imagine that my saga would end up in a wiki :P :-X  :-[, but I really don't mind since there's more chance for someone to see it there and not learn the hard way like I had to. Hopefully in time someone will get an idea (I don't) how to concisely present this fact without having me telling the whole story.
ct2laz - Conversion between Lazarus and CodeTyphon
bithelpers - Bit manipulation for standard types
pasettimino - Siemens S7 PLC lib

 

TinyPortal © 2005-2018