[PyQt] SIP: memory leak in mapped type?

Giovanni Bajo rasky at develer.com
Mon Jul 30 13:11:12 BST 2007


On 7/28/2007 11:43 PM, Phil Thompson wrote:

>>> The leak that your test case demonstrated had nothing to do
>>> with /Transfer/ or
>>> sipTransferObj. If you still have a leak then I need another test
>>> case.
>> You mentioned that you fixed a memory leak in SIP with mapped types
>> and /Out/ annotations. This is one of the two leaks in my testcase (when
>> calling the function with the /Out/ annotation). But in the other leak
>> in my testcase, there is no /Out/ annotation, only a return value.
>>
>> Will that be fixed as well with tonight snapshot?
> 
> Sorry, I misread your email. Both tests now use the same amount of memory.
> 
> The other leak is down to you using sipConvertFromInstance() instead of 
> sipConvertFromNewInstance(). I'd forgotten that a transfer object of NULL 
> means different things to the two functions.

OK that's fine, I verified that the original problems are fixed with 
latest snapshot and that fix.

I offer stl.sip for inclusion in SIP. It covers my own needs right now 
(vectors) but shall I need to wrap more STL containers (sets, maps, 
ecc.) I would updated it with support for them. I guess that it might be 
useful for people wrapping C++ code with SIP.

There is a high degree for redundancy in it, as you can see. You might 
want to think about it as a way to improve SIP itself.
-- 
Giovanni Bajo



More information about the PyQt mailing list