[prev in list] [next in list] [prev in thread] [next in thread]
List: pykde
Subject: Re: [PyQt] [SIP] wrap a class with protected destructor
From: Phil Thompson <phil () riverbankcomputing ! com>
Date: 2009-11-25 18:42:07
Message-ID: a2653133ea7dcc16a8e4a00f0a006930 () localhost
[Download RAW message or body]
On Mon, 23 Nov 2009 10:01:45 +0100, Sébastien Petitdemange
<sebastien.petitdemange@esrf.fr> wrote:
> 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 ?
You wrap a protected dtor just as you would wrap a public dtor. It looks
like you haven't done this.
Phil
_______________________________________________
PyQt mailing list PyQt@riverbankcomputing.com
http://www.riverbankcomputing.com/mailman/listinfo/pyqt
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic