[Gc] Re: Memory leak located!

Martin Wartens martin.wartens at mymail.ch
Mon May 26 16:24:12 PDT 2008

If I followed the thread correctly, you have some class like
struct Sample: public gc
   std::string bla;
   std::map blubb;

This won't work, Sample must derive from gc_cleanup, since the destructors of 
string, map etc. have to be called to free their memory. Your addition of 
gc_allocator will free the most part of the memory, but not the string/map 
objects themselves, so you still have a leak.
I recommend not to mix gc/non-gc, since this just creates headaches like that.

Greetings, Martin

More information about the Gc mailing list