From: Barry S. <ba...@ba...> - 2011-02-06 12:50:01
|
On 28 Dec 2010, at 14:59, Barry Scott wrote: > > 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. With the fix in place I do not see any issues. But I failed to have a detectable memory leak with the decode calls, however the docs are clear so I'm coding against the docs. Barry |