|
From: William S F. <ws...@fu...> - 2006-10-27 19:21:42
|
Petr Novotny wrote: >> From: William S Fulton [mailto:ws...@fu...] >> Sent: 25 October 2006 22:03 >> >> John Lenz wrote: >>> On 10/23/06 10:45, Petr Novotny wrote: >>>> Hi, >>>> > [snip] >>> No, the newfree typemap is for freeing temporary memory >> created during >>> the typemap, that is used to build the real return value. >> No, the newfree typemap is only used when %newobject is used. The >> freearg typemap is used to freeing up temporary memory created during >> the in typemap. > > Let me see if I understand this well. %newobject means two things, depending on typemaps: > 1. newfree typemap is invoked, if defined. > 2. The pointer is wrapped with SWIG_OWNER flag, if it is wrapped. > > Am I right? > Both are right. If you define %newobject, it will use the newfree typemap (if available) and it will define SWIG_OWNER flag if it is a complex type. %newobject defining SWIG_OWNER is target language dependent, so for example in Java it will instead create the proxy class setting the swigCMemOwn flag. > [snip] > > You say that the documentation is correct. You may be right, but the problem here is that the documentation is misleading. I think it should be more explicit about what %newobject means. > Can you give a reference as to which bit is misleading as %newobject is mentioned in 10 different chapters? William |