[antlr-interest] c++ memory leaks

Ric Klaren klaren at cs.utwente.nl
Mon Mar 4 01:14:11 PST 2002


On Mon, Mar 04, 2002 at 07:54:18AM -0000, marc_schellens wrote:
> MyLexer::MyLexer(std::istream& in)
> 	: antlr::CharScanner(new antlr::CharBuffer(in))
> {
> 	setCaseSensitive(false);
> 	initLiterals();
> }
> 
> So here is a new CharBuffer alloccated on the heap.
> But where is it freed?
> MyLexer hasn't a destructor and ~CharScanner() does nothing.
> 
> I would say thats a memory leak, or what am I missing?

See LexerInputState.hpp

Ric
-- 
-----+++++*****************************************************+++++++++-------
    ---- Ric Klaren ----- klaren at cs.utwente.nl ----- +31 53 4893722  ----
-----+++++*****************************************************+++++++++-------
     Human beings, who are almost unique in having the ability to learn
   from the experience of others, are also remarkable for their apparent
         disinclination to do so. --- Douglas Adams, Last Chance to See


 

Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/ 



More information about the antlr-interest mailing list