I don't understand the purpose of the typemap found in (master) Lib/typemaps/inoutlist.swg :

104: %typemap(freearg,noblock=1,match="in") Type *INPUT, Type &INPUT {
105:     if (SWIG_IsNewObj(res$argnum)) %delete($1);
106: }

I don't see any use of res$argnum in the other related typemaps:

92 : %typemap(in,noblock=1,fragment=asval_frag) Type &INPUT($*ltype temp, int res = 0) {

107: %typemap(typecheck,noblock=1,precedence=code,fragment=asval_frag) Type *INPUT, Type &INPUT {

And why %delete($1) ?

By the way, it makes some test cases (in the Scilab test-suite) fail to build  (res$argnum variable is not declared).

I would be grateful if you could give me some explanations on this typemap.

Simon M.