swig no longer generates delete_* function when no addmethods mode.

Deal with it.


git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@646 626c5289-ae23-0410-ae9c-e8d60b6d4f22
This commit is contained in:
Masaki Fukushima 2000-08-13 13:45:41 +00:00
commit a16e3deec3

View file

@ -1211,10 +1211,18 @@ void RUBY::cpp_destructor(char *name, char *newname) {
Printv(freefunc, "free_", klass->cname, 0);
Printv(freeproto, "static void ", freefunc, "(", klass->type, " *);\n", 0);
Printv(freebody, "static void\n",
freefunc, "(", klass->type, " *ptr) {\n",
tab4, Swig_name_destroy(name), "(ptr);\n",
"}\n",
0);
freefunc, "(", klass->type, " *", Swig_cparm_name(0,0), ") {\n",
tab4, 0);
if (AddMethods) {
Printv(freebody, Swig_name_destroy(name), "(", Swig_cparm_name(0,0), ")", 0);
} else {
/* When no addmethods mode, swig emits no destroy function. */
if (CPlusPlus)
Printv(freebody, Swig_cppdestructor_call(), 0);
else
Printv(freebody, Swig_cdestructor_call(), 0);
}
Printv(freebody, ";\n}\n", 0);
if (CPlusPlus) {
Insert(freefunc,0,"VOIDFUNC(");
Append(freefunc,")");