struct ownership, cpp SIP

Marian Thomsen marian.th at outlook.de
Wed Apr 21 11:37:04 BST 2021


Hello,

I'm translating a c++ api that has a struct cascade. A struct0 holding struct1 that holds struct2 and so on.
In some situations it is necessary to fill e.g. struct 2 with values and pass (by assignment =) it to struct1. When I'm doing this in a loop I get a segmentation fault.

I suspect that struct1 has not ownership of struct2 and struct2 gets deleted to early. My current workaround is to declare struct2 globally, but I would like to find another solution in the long run.

Is there something I can do about that with SIP? Can I e.g. force the transfer of ownership during the assignment from struct2 to struct1 somehow?

Thanks for the help.

Regards,

M.T.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://www.riverbankcomputing.com/pipermail/pyqt/attachments/20210421/72da2b30/attachment.htm>


More information about the PyQt mailing list