tcpp icon indicating copy to clipboard operation
tcpp copied to clipboard

Include model can introduce memory leaks

Open redorav opened this issue 4 years ago • 0 comments

The include model doesn't lend itself very well to good memory management. The includer callback expects to receive a pointer to a IInputStream, but doesn't really clean up after itself or anything, so it kind of expects that one keeps track of all the includes somehow and deletes them after. I wonder if it would be better to either:

  1. Call delete on every object we pass through after it's done parsing
  2. Pass in a reference to a IInputStream and let the user fill it in?

Just a thought.

redorav avatar Sep 11 '21 21:09 redorav