[PyKDE] sip and virtual private destructors

Phil Thompson phil at riverbankcomputing.co.uk
Sat Jun 28 16:45:01 BST 2003


On Wednesday 25 June 2003 6:03 pm, Gerard Vermeulen wrote:
> On Wed, 25 Jun 2003 09:13:21 -0400
>
> "A.M. Kuchling" <amk at asti-usa.com> wrote:
> > I'm wrapping a C++ library with SIP, and have a class with a virtual
> > private destructor.  sip reports a parse error when confronted with a
> > declaration like "virtual ~GmOptions();".  I can remove the "virtual"
> > qualifier, but then the module fails to load, unable to find a mangled
> > "_ZTI9GmOptions" symbol that I'm guessing is due to the destructor
> > type being wrong.
> >
> > Any suggestions?  Are there any virtual destructors wrapped in PyQt or
> > PyKDE that I could look at as an example?
>
> My advice is not to wrap the virtual destructors.
>
> Some background:
> (1) support of virtual destructors in sip is about a week old (see a
> recent snapshot).

The change is actually trivial. The code that is generated has always been 
generated in 99% of cases that it was needed. The change made it 100% (and 
helped fix the memory leak when using QCustomEvent).

> (2) sip derives interface classes from the wrapped classes; in this
> scheme it is hard to see how sip can handle private virtual destructors
> (but I am not the most qualified person to say so).

That's correct - they can't be handled.

Phil




More information about the PyQt mailing list