Perl - Add support for missing directorfree typemaps

Related to issue #1167, to free up memory when returning reference types.
SWIG_Perl_AcquirePtr still needs implementing.
This commit is contained in:
William S Fulton 2017-12-14 07:49:56 +00:00
commit 717b7866d4
3 changed files with 21 additions and 0 deletions

View file

@ -900,6 +900,15 @@ public:
Printf(f->code, "%s\n", tm);
}
if (director_method) {
if ((tm = Swig_typemap_lookup("directorfree", n, Swig_cresult_name(), 0))) {
Replaceall(tm, "$input", Swig_cresult_name());
Replaceall(tm, "$result", "ST(argvi)");
Printf(f->code, "%s\n", tm);
Delete(tm);
}
}
Printv(f->code, "XSRETURN(argvi);\n", "fail:\n", cleanup, "SWIG_croak_null();\n" "}\n" "}\n", NIL);
/* Add the dXSARGS last */