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

Re: newobject and feature("ref")

by David Piepgrass :: Rate this Message:

Reply to Author | View in Thread

> > That sounds like a bug to me. But feature("ref") won't automatically
> > increment the refcount on objects returned from functions other than the
> > ref-counted class's constructor, so I do not use feature("ref") at all
> in
> > my programs. I use feature("unref") but not feature("ref").
>
> I am quite happy with feature("ref") and it works really well with any
> method
> returning an object of type (or derived from that) RefCountObject.
>
> Unfortunately is does not work if a class method returns that type thats
> class
> is *not* derived from RefCountObject. For me it looks like a bug, too.
> Btw, I
> generate Python wrappers with that.

By the way, it occurs to me %feature("ref") might work differently in Python than in C#... I remember getting that impression from something I read a long time ago on the mailing list but now I forget. I know I didn't notice the bug you describe back when I was trying out %feature("ref")... but then, I didn't use it very long since its semantics are not very useful, at least in C#.

------------------------------------------------------------------------------
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

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