diff --git a/Source/Modules/chicken.cxx b/Source/Modules/chicken.cxx index c501db98a..5466890dc 100644 --- a/Source/Modules/chicken.cxx +++ b/Source/Modules/chicken.cxx @@ -1162,6 +1162,8 @@ int CHICKEN::membervariableHandler(Node *n) { } Delete(proc); + Delete(setfunc); + Delete(getfunc); return SWIG_OK; } diff --git a/Source/Modules/perl5.cxx b/Source/Modules/perl5.cxx index 7def7b93c..a6273ee80 100644 --- a/Source/Modules/perl5.cxx +++ b/Source/Modules/perl5.cxx @@ -765,9 +765,11 @@ public: SwigType *t = Getattr(n, "type"); Wrapper *getf, *setf; String *tm; + String *getname = Swig_name_get(iname); + String *setname = Swig_name_set(iname); - String *set_name = Swig_name_wrapper(Swig_name_set(iname)); - String *val_name = Swig_name_wrapper(Swig_name_get(iname)); + String *get_name = Swig_name_wrapper(getname); + String *set_name = Swig_name_wrapper(setname); if (!addSymbol(iname, n)) return SWIG_ERROR; @@ -801,7 +803,7 @@ public: /* Now write a function to evaluate the variable */ int addfail = 0; - Printf(getf->def, "SWIGCLASS_STATIC int %s(pTHX_ SV *sv, MAGIC *SWIGUNUSEDPARM(mg)) {\n", val_name); + Printf(getf->def, "SWIGCLASS_STATIC int %s(pTHX_ SV *sv, MAGIC *SWIGUNUSEDPARM(mg)) {\n", get_name); Printv(getf->code, tab4, "MAGIC_PPERL\n", NIL); if ((tm = Swig_typemap_lookup_new("varout", n, name, 0))) { @@ -850,10 +852,10 @@ public: } /* Now add symbol to the PERL interpreter */ if (GetFlag(n, "feature:immutable")) { - Printv(variable_tab, tab4, "{ \"", cmodule, "::", iname, "\", MAGIC_CLASS swig_magic_readonly, MAGIC_CLASS ", val_name, ",", tt, " },\n", NIL); + Printv(variable_tab, tab4, "{ \"", cmodule, "::", iname, "\", MAGIC_CLASS swig_magic_readonly, MAGIC_CLASS ", get_name, ",", tt, " },\n", NIL); } else { - Printv(variable_tab, tab4, "{ \"", cmodule, "::", iname, "\", MAGIC_CLASS ", set_name, ", MAGIC_CLASS ", val_name, ",", tt, " },\n", NIL); + Printv(variable_tab, tab4, "{ \"", cmodule, "::", iname, "\", MAGIC_CLASS ", set_name, ", MAGIC_CLASS ", get_name, ",", tt, " },\n", NIL); } /* If we're blessed, try to figure out what to do with the variable @@ -876,8 +878,10 @@ public: DelWrapper(setf); DelWrapper(getf); + Delete(getname); + Delete(setname); Delete(set_name); - Delete(val_name); + Delete(get_name); return SWIG_OK; } diff --git a/Source/Modules/ruby.cxx b/Source/Modules/ruby.cxx index a3bac2f24..62f2240e0 100644 --- a/Source/Modules/ruby.cxx +++ b/Source/Modules/ruby.cxx @@ -1416,7 +1416,8 @@ public: /* create getter */ int addfail = 0; - getfname = Swig_name_get(iname); + String *getname = Swig_name_get(iname); + getfname = Swig_name_wrapper(getname); Printv(getf->def, "SWIGINTERN VALUE\n", getfname, "(", NIL); Printf(getf->def, "VALUE self"); Printf(getf->def, ") {"); @@ -1445,7 +1446,8 @@ public: setfname = NewString("NULL"); } else { /* create setter */ - setfname = Swig_name_set(iname); + String *setname = Swig_name_set(iname); + setfname = Swig_name_wrapper(setname); Printv(setf->def, "SWIGINTERN VALUE\n", setfname, "(VALUE self, ", NIL); Printf(setf->def, "VALUE _val) {"); tm = Swig_typemap_lookup_new("varin", n, name, 0); @@ -1463,6 +1465,7 @@ public: Printv(setf->code, tab4, "return Qnil;\n", NIL); Printf(setf->code, "}\n"); Wrapper_print(setf, f_wrappers); + Delete(setname); } /* define accessor method */ @@ -1502,6 +1505,7 @@ public: Delete(s); break; } + Delete(getname); Delete(getfname); Delete(setfname); DelWrapper(setf);