Hello fellow swig enthusiasts,
If I extend a C++ class with a function that returns a pointer to a
newly instantiated object is there a way to force SWIG/Python to take
ownership of the object without me using ConvertPtr and returning a
PyObject* instead. Here is my example:
%extend MyClass
{
MyClassHelper* new_helper()
{
MyClassHelper *newHelper = new MyClassHelper();
/* DO SOME IMPORTANT STUFF HERE*/
return newHelper;
}
}
It appears that these new helper objects never get deleted using this
code. Any help is greatly appreciated!
Thanks,
Greg
-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/_______________________________________________
Swig-user mailing list
Swig-user@...
https://lists.sourceforge.net/lists/listinfo/swig-user