allow to apply freearg ven when no in typemap is in place when numimputs=0

git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@8461 626c5289-ae23-0410-ae9c-e8d60b6d4f22
This commit is contained in:
Marcelo Matus 2006-01-15 18:01:11 +00:00
commit e1d78b0dec
2 changed files with 6 additions and 6 deletions

View file

@ -1744,7 +1744,8 @@ public:
/* Insert cleanup code */ /* Insert cleanup code */
for (p = l; p;) { for (p = l; p;) {
if (!checkAttribute(p,"tmap:in:numinputs","0") && !Getattr(p,"tmap:in:parse")) { // if (!checkAttribute(p,"tmap:in:numinputs","0") && !Getattr(p,"tmap:in:parse")) {
if (!Getattr(p,"tmap:in:parse")) {
tm = Getattr(p,"tmap:freearg"); tm = Getattr(p,"tmap:freearg");
if (Getattr(p,"tmap:freearg:implicitconv")) { if (Getattr(p,"tmap:freearg:implicitconv")) {
const char *convflag = "0"; const char *convflag = "0";
@ -1752,9 +1753,7 @@ public:
SwigType *ptype = Getattr(p,"type"); SwigType *ptype = Getattr(p,"type");
convflag = get_implicitconv_flag(classLookup(ptype)); convflag = get_implicitconv_flag(classLookup(ptype));
} }
tm = (strcmp(convflag,"0") != 0) ? Getattr(p,"tmap:freearg") : 0; tm = (strcmp(convflag,"0") != 0) ? tm : 0;
} else {
tm = Getattr(p,"tmap:freearg");
} }
if (tm && (Len(tm) != 0)) { if (tm && (Len(tm) != 0)) {
Replaceall(tm,"$source",Getattr(p,"lname")); Replaceall(tm,"$source",Getattr(p,"lname"));

View file

@ -914,7 +914,8 @@ public:
void insertCleanupCode(ParmList *l, String *cleanup) { void insertCleanupCode(ParmList *l, String *cleanup) {
String *tm; String *tm;
for (Parm *p = l; p; ) { for (Parm *p = l; p; ) {
if (!checkAttribute(p,"tmap:in:numinputs","0") && (tm = Getattr(p,"tmap:freearg"))) { // if (!checkAttribute(p,"tmap:in:numinputs","0") && (tm = Getattr(p,"tmap:freearg"))) {
if ((tm = Getattr(p,"tmap:freearg"))) {
if (Len(tm) != 0) { if (Len(tm) != 0) {
Replaceall(tm,"$source",Getattr(p,"lname")); Replaceall(tm,"$source",Getattr(p,"lname"));
Printv(cleanup,tm,"\n",NIL); Printv(cleanup,tm,"\n",NIL);