Add cleanup code (copy and modify from tcl.cxx)

This commit is contained in:
Yung Lee 2013-04-29 20:18:32 +08:00
commit 0a66805e7a

View file

@ -357,6 +357,20 @@ public:
}
}
/* Add cleanup code */
for (param = functionParamsList; param;) {
String *tm;
if ((tm = Getattr(param, "tmap:freearg"))) {
if (tm && (Len(tm) != 0)) {
Replaceall(tm, "$source", Getattr(param, "lname"));
Printf(wrapper->code, "%s\n", tm);
Delete(tm);
}
param= Getattr(param, "tmap:freearg:next");
} else {
param = nextSibling(param);
}
}
/* Close the function(ok) */
Printv(wrapper->code, "return SWIG_OK;\n", NIL);