Re: C++ to Python and returning members of a C++ object

Terry Barnaby <[email protected]>
Newsgroups gmane.comp.programming.swig
Message-ID <[email protected]>
Hi Jake,

I have been away from this for a while with other work.

You stated:
On 19/08/2020 09:36, Terry Barnaby wrote:
> It segfaults on pointer-category objects because you should be passing 
> "self" as the first argument not "args", I corrected that for the 
> benchmarks above.

Not sure what you mean here, the only place I use "args " is in:

    Printf(f->code, "SwigContainerReference(args, resultobj); // 
Increment reference count of the container object and add a pointer to 
the container to this in the returned object\n");

And this seems correct, certainly I can't use "self" in place of "args" 
here as the code won't compile. May I ask what change you made here ?

I'm not sure where the SWIG group want to go on this. For the projects 
I'm involved in I need this fix to eliminate the memory faults when 
returning C++ members in Python so I will be creating my own local 
version of SWIG, with my patch applied, for now. But I am keen to try 
and get something like this included in the main tree if possible.

Terry



_______________________________________________
Swig-user mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/swig-user
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.