[PyQt] SIP newbie question, adding a destructor to a C struct

Phil Thompson phil at riverbankcomputing.com
Fri Oct 22 10:11:08 BST 2010


On Thu, 21 Oct 2010 22:36:09 +0200, Riccardo Vianello
<riccardo.vianello at gmail.com> wrote:
> Hi all,
> 
> I'm trying to wrap a C structure that requires some
> initialization/disposal code. As far as I could understand, I should
> provide the wrapper definition with the "C++" prototypes for a
> constructor/destructor pair and associate each of them with the
> required code in a %MethodCode directive. This seems to work as I
> expected for the constructor, but I couldn't find the destructor's
> code anywhere in the generated code.. I might be missing something
> obvious, but after spending some time on this without success, I would
> be grateful if anyone could provide a hint. The specification file I'm
> using is similar to the one I copied here below.

It's a bug - fixed in the repository. I hope to make the next SIP release
later today.

Thanks,
Phil


More information about the PyQt mailing list