From: Barry S. <ba...@ba...> - 2010-12-28 15:21:44
|
On 15 Dec 2010, at 15:18, Нестеров Евгений wrote: > Hello! > > It seems that I have found a potential MemLeak. I post bug in tracker: > https://sourceforge.net/tracker/?func=detail&aid=3137322&group_id=3180&atid=103180 > and today found why. > > String decode( const char *encoding, const char *error="strict" ) > { > return Object( PyString_AsDecodedObject( ptr(), encoding, > error ) ); > } > Py::Object must be owner of new reference, second attr of counstructor > must be true: > > String decode( const char *encoding, const char *error="strict" ) > { > return Object( PyString_AsDecodedObject( ptr(), encoding, > error ), true ); > } > > What you think about this? > > -- > Нестеров Евгений I have reproduced the leak but there are oddities. In that not all calls to encode and decode cause a leak between python 2.x and 3.1. I need to review and test deeper to see what is wrong here. Barry |