On Sat, Jan 24, 2009 at 05:00:02PM +0000, Jeremy Henty wrote:
The CSS parser gurus will have to verify this for me, but it *seems* to me that the leak is because the CssSimpleSelector class does not clean up its id, klass and pseudo members. Furthermore the only method that sets those members is Css_parse_simple_selector(), and it always assigns them to new heap-allocated values. So I reckon the fix is just to add a CssSimpleSelector destructor that dFree()s those members. Have I missed anything?
No, you are right, but the problem is that the destructor is not called atm. CssSimpleSelector is embedded in struct CombinatorAndSelector which in turn lives in a lout::misc::SimpleVector. So the memory is allocated with malloc and not properly handled with new/delete. This is nasty and has to be fixed somehow. Regards, Johannes