tcpp
tcpp copied to clipboard
Include model can introduce memory leaks
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:
- Call delete on every object we pass through after it's done parsing
- Pass in a reference to a IInputStream and let the user fill it in?
Just a thought.