On Sunday 13 January 2013 12:06:45 Yann Lanthony wrote:
> I've just tested to create a slot like yours (creating and returning an
> instance of my custom model) in my minimal app and I have no segfault.
> Maybe it's because you don't give your  TargetListModel a parent. So you
> create it and immediately return it but no one takes its ownership and it's
> deleted to soon. This might explain the segfault.

Setting a parent works!

If I understand correctly, Python loses its last reference to it (which 
doesn't happen in the wiki example) but when setting a parent PySide increases 
the Python refcount so it doesn't get GCed until the parent object is GCed. 
Does that sound right?

Thanks a lot, 
Yosef.
_______________________________________________
PySide mailing list
[email protected]
http://lists.qt-project.org/mailman/listinfo/pyside

Reply via email to