SWIG_RubyAddTracking and SWIG_RubyRemoveTracking were not being correctly generated since they were looking for featue:trackobjects on the constructor/destructor nodes as opposed to the class node.

git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@8338 626c5289-ae23-0410-ae9c-e8d60b6d4f22
This commit is contained in:
Charlie Savage 2006-01-10 00:29:57 +00:00
commit e6814c1841

View file

@ -1140,7 +1140,7 @@ public:
}
if (action) {
Append(action,"DATA_PTR(self) = result;\n");
if (GetFlag(n,"feature:trackobjects")) {
if (GetFlag(pn,"feature:trackobjects")) {
Append(action,"SWIG_RubyAddTracking(result, self);\n");
}
}
@ -1947,6 +1947,14 @@ public:
freefunc, "(", klass->type, " *", pname0, ") {\n",
tab4, NIL);
/* Check to see if object tracking is activated for the class
that owns this destructor. */
Node *pn = Swig_methodclass(n);
if (GetFlag(pn,"feature:trackobjects")) {
Printf(freebody, "SWIG_RubyRemoveTracking(%s);\n", pname0);
Printv(freebody, tab4, NIL);
}
if (Extend) {
String *wrap = Getattr(n, "wrap:code");
if (wrap) {
@ -1967,9 +1975,6 @@ public:
}
}
if (GetFlag(n,"feature:trackobjects")) {
Printf(freebody, " SWIG_RubyRemoveTracking(%s);\n", pname0);
}
Printv(freebody, "}\n\n", NIL);
Printv(f_wrappers, freebody, NIL);