[PyKDE] Leaking in virtual handler
Phil Thompson
phil at riverbankcomputing.co.uk
Sat Apr 23 12:47:32 BST 2005
On Wednesday 20 April 2005 10:09 pm, James Emerton wrote:
> I have found a memory leak owing to how SIP handles virtual methods.
> If a type conversion is done by sipParseResult(), a new object is
> allocated but never deleted.
>
> I have an interface that returns a QString. If I implement this in
> python and return a python string, a conversion to QString is
> performed by creating a new QString instance. This instance is never
> deallocated.
>
> I have attached a patch which appears to correct this. I am not
> entirely comfortable with the way I am detecting whether sipResOrig is
> the same as the pointer contained in sipResObj.
The patch isn't quite right - but I think the basic idea is sound. It will be
in the next snapshot.
Thanks,
Phil
More information about the PyQt
mailing list