[PyKDE] Modify init/dealloc on structs

Daniele Varrazzo daniele.varrazzo at gmail.com
Wed Jul 12 14:29:26 BST 2006


Hello,

i need to wrap C structures that require some initialization (they
must be memsetted to 0) and careful freeing if C-owned (to free
aggregate structures as well).

Can %MethodCode be used to customize dealloc_ABC and init_ABC code for
a wrapped ABC struct? How?

Alternatively i could provide a /Factory/ function to correctly
initialize an ABC instance, but then i'd like to hide ABC from he
module interface and only expose createABC() to avoid the creation of
uninitialized structures. Furthermore troubles remain on destruction
(expose a destryABC?)

What is the best approach to tackle this kind problem with SIP?

Thank you very much,

Daniele




More information about the PyQt mailing list