Moray Taylor wrote:

> I think I have figured out how to do it.
> 
> MyCanvasItem.setCanvas(None)
> 
> It gets rid of it, and seems to free any memory it was using.
> 
> Any comments?


Yes - I'd forgotten I'd already taken care of this. If you look at the 
implementation of QCanvasItem.setCanvas() in qcanvas.sip, ownership is 
transferred to C++ if the item is now allocated to a canvas and 
transferred back to Python if it is not now allocated to a canvas.

Obviously, once ownership is back with Python the C++ dtor will get 
called when the Python object is garbage collected.

Phil

_______________________________________________
PyKDE mailing list    [EMAIL PROTECTED]
http://mats.gmd.de/mailman/listinfo/pykde

Reply via email to