%newobject and typemap(out)

"Langer, Stephen A. \(Fed\) via Swig-user" <[email protected]> Thu, 7 Jul 2022 14:18:13 +0000
Newsgroups gmane.comp.programming.swig
Message-ID <[email protected]>
Hi --

Is it possible for a typemap to know whether or not it's being invoked in conjunction with %newobject?

If %newobject is used on a function where the return value has a typemap(newfree) but no typemap(out), the wrapper will correctly delete the return value.  But if there's a typemap(out), newfree doesn't seem to be used.  How can a typemap(out) know whether or not it should delete the return value? 

Thanks.
 -- Steve