« Return to Thread: newobject and feature("ref")

newobject and feature("ref")

by tahoma :: Rate this Message:

Reply to Author | View in Thread

Hi all,

I want to use my own reference counting when wrapping my classes. When using
%feature("ref") and %newobject the reference counter will be increased only in
methods of classes derived from RefCountObject. I thought the ref/unref
feature is applied to any return type derived from RefCountObject when
%newobject is used.

A small example is given in test.h/test.i. Creator1, Creator2 and a global
function create instances of type RefCountObject, but only the reference
counter of instances returned by Creator2 are increased. Creator2 is the only
class that also derives from RefCountObject.

Is that behaviour intended or did I miss something important? I want to use
tool classes that do not derive from RefCountObject but creating or returning
RefCountObject's.

I tried swig 1.3.35 - 1.3.39.

Best regards,
Jan
--
GRATIS für alle GMX-Mitglieder: Die maxdome Movie-FLAT!
Jetzt freischalten unter http://portal.gmx.net/de/go/maxdome01



------------------------------------------------------------------------------
Are you an open source citizen? Join us for the Open Source Bridge conference!
Portland, OR, June 17-19. Two days of sessions, one day of unconference: $250.
Need another reason to go? 24-hour hacker lounge. Register today!
http://ad.doubleclick.net/clk;215844324;13503038;v?http://opensourcebridge.org
_______________________________________________
Swig-user mailing list
Swig-user@...
https://lists.sourceforge.net/lists/listinfo/swig-user

test.h (844 bytes) Download Attachment
test.i (302 bytes) Download Attachment

 « Return to Thread: newobject and feature("ref")