Revert r13601 as it breaks older versions of R

git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@13713 626c5289-ae23-0410-ae9c-e8d60b6d4f22
This commit is contained in:
William S Fulton 2012-08-20 21:20:19 +00:00
commit be1c4d2e68
2 changed files with 17 additions and 35 deletions

View file

@ -1891,9 +1891,6 @@ int R::functionWrapper(Node *n) {
if(nargs == -1)
nargs = getFunctionPointerNumArgs(p, tt);
Printv(sfun->code, "if (.hasSlot(", name, ", \"ref\")) {\n",
name, " = slot(", name, ", \"ref\");\n",
"}\n", NIL);
String *snargs = NewStringf("%d", nargs);
Printv(sfun->code, "if(is.function(", name, ")) {", "\n",
"assert('...' %in% names(formals(", name,
@ -2115,8 +2112,7 @@ int R::functionWrapper(Node *n) {
{
String *finalizer = NewString(iname);
Replace(finalizer, "new_", "", DOH_REPLACE_FIRST);
Printf(sfun->code, "if (.hasSlot(ans, \"ref\")) {\n"
"reg.finalizer(ans@ref, delete_%s); }\n", finalizer);
Printf(sfun->code, "reg.finalizer(ans, delete_%s)\n", finalizer);
}
Printf(sfun->code, "ans\n");
}