Re: [Fwd: memory leaks in python interface [was Hash view questions]]
Ralf Schmitt <[email protected]> Sat, 04 Mar 2006 19:49:59 +0100
| Newsgroups | gmane.comp.db.metakit |
|---|---|
| Message-ID | <[email protected]> |
Ralf Schmitt schrieb: > I'm pretty much convinced that the python wrapper code contains even > more leaks... > Maybe I'll do some more tests... > Turns out that the patch I sent may trigger segfaults . The problem is that the PWOMappingMmbr class does not have a copy constructor and consequently just copies memory instead of counting references. C++ is such a pig. I didn't notice this the first time, since I think the compiler may or may not use a copy constructor for statements such as PWOMappingMmbr res = PWOMappingMmbr(rslt, *this, _key); depending on the compiler and optimizations being used. In case it uses the "memcpy copy constructor", the _key member is being decrefed one too many times. I'll send another patch. - Ralf _____________________________________________ Metakit mailing list - [email protected] http://www.equi4.com/mailman/listinfo/metakit