[QGIS-Developer] Is it just me, or is sip totally broken?
nyall.dawson at gmail.com
Mon Jan 7 13:50:58 PST 2019
On Mon, 7 Jan 2019 at 21:11, Martin Dobias <wonder.sk at gmail.com> wrote:
> Hi Nyall
> I have seen that too with other QGIS registries, but I am not sure if
> it is actually broken in SIP or if this should be simply handled in a
> different way.
> My understanding is that SIP for an object has the "c++ part" and
> "python part". If we do not deal with subclasses, things seem to work
> nicely: if you pass object of type X to function "myfunc(X* x
> /Transfer/)" then the object gets ownership passed to C++, and then
> when in python the object gets out of scope, its "python part" get
> deleted because it is not necessary anymore and only the "c++ part"
> keeps on living (and will be deleted in c++ code. The trouble is when
> passing derived classes with /Transfer/ where the "python part" is
> actually important, but it still gets deleted.
I don't think this is by design though -- see
, where Phil states that Transfer is *supposed* to work as we want it
to, and avoid the deletion of the Python part.
There's also this from today (same question):
But I don't believe this is the solution -- to me it seems that our
super types are already sip.wrapper, and that this is the default (see
More information about the QGIS-Developer