[PyQt] [SIP] wrap a class with protected destructor

Sébastien Petitdemange sebastien.petitdemange at esrf.fr
Mon Nov 23 09:01:45 GMT 2009


Hi List,

I try to use the new release of sip (4.9.2) and I notice that destructor
wrapping is different from sip 4.7.9. And I have a compilation error:

sip 4.9.2 generate this for the destructor:
	
static void release_SinkTaskBase(void *sipCppV,int sipState)
{
    SinkTaskBase *sipCpp = reinterpret_cast<SinkTaskBase *>(sipCppV);

#line 338 "processlib_tmp.sip"
 Py_BEGIN_ALLOW_THREADS;
 sipCpp->unref();
 Py_END_ALLOW_THREADS;
#line 216 "sipprocesslibSinkTaskBase.cpp"

    Py_BEGIN_ALLOW_THREADS

    if (sipState & SIP_DERIVED_CLASS)
        delete reinterpret_cast<sipSinkTaskBase *>(sipCppV);
    else
        delete reinterpret_cast<SinkTaskBase *>(sipCppV);

    Py_END_ALLOW_THREADS
}

and as the SinkTaskBase object has a protected Destructor so the
compilation failed.

previously sip 4.7.9 only use the %MethodCode provide so the wrapping
method look like that:

static void release_SinkTaskBase(void *sipCppV,int)
{
    SinkTaskBase *sipCpp = reinterpret_cast<SinkTaskBase *>(sipCppV);
#line 338 "processlib_tmp.sip"
 Py_BEGIN_ALLOW_THREADS;
 sipCpp->unref();
 Py_END_ALLOW_THREADS;
#line 215 "sipprocesslibSinkTaskBase.cpp"
}

Is there a way (New key word) to wrap a protected or even private
destructor ?


Thanks in advance,

SEB
-------------- next part --------------
A non-text attachment was scrubbed...
Name: sebastien_petitdemange.vcf
Type: text/x-vcard
Size: 210 bytes
Desc: not available
Url : http://www.riverbankcomputing.com/pipermail/pyqt/attachments/20091123/7a85c118/sebastien_petitdemange.vcf


More information about the PyQt mailing list