[prev in list] [next in list] [prev in thread] [next in thread] 

List:       pykde
Subject:    [PyQt] KeepReference in constructors for wrapped instances
From:       Giovanni Bajo <rasky () develer ! com>
Date:       2011-02-15 13:13:42
Message-ID: 1297775622.2212.181.camel () lilax
[Download RAW message or body]

Hi Phil,

given the following (pseudo) sip file:

===================================================
class Manager
{ ... };

class User
{
public:
     User(Manager * /KeepReference=0/);
     void changeManager(Manager * /KeepReference=0/);
}
===================================================

it looks like the internal sip_api_keep_reference is not called when
passing through the constructor. Not only the generated .cpp file does
not have an explicit call to sipKeepReference() in the constructor
(whilst it calls it for the changeManager method), but even stepping
through code in the argument-parsing function I couldn't see any calls
to sip_api_keep_reference.

I also checked PyQt, but it looks like /KeepReference/ in constructors
is only used for classes like QLatin1String, for a "const char*"
argument, which is special-cased in the argument-parsing code with
letter 'A'. I could not find any usage of KeepReference for wrapped
instances in PyQt constructors, probably because the Qt ownership system
is a superset of its functionality.

The documentation does not mention anything specific about KeepReference
in constructors.

Is it a bug in SIP?

BTW I'm using SIP 4.10, though I checked the changelog and the Mercurial
history and I could only find minimal changes in the keep reference
code.

Thanks!
-- 
Giovanni Bajo   ::  rasky@develer.com
Develer S.r.l.  ::  http://www.develer.com

My Blog: http://giovanni.bajo.it
Last post: Compile-time Function Execution in D

_______________________________________________
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