better treatment of the '0' director methods case

git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@5658 626c5289-ae23-0410-ae9c-e8d60b6d4f22
This commit is contained in:
Marcelo Matus 2004-01-21 01:04:50 +00:00
commit 7b6925d8ca

View file

@ -1478,6 +1478,20 @@ int Language::unrollVirtualMethods(Node *n,
virtual_destructor = 1;
}
}
/*
We delete all the nodirector methods. This prevents the
generation of 'empty' director classes.
But this has to be done outside the previous loop!.
*/
Iterator k;
for (k = First(vm); k.key; k = Next(k)) {
String *method = Getattr(k.item, "methodNode");
if (!Cmp(Getattr(method, "feature:nodirector"), "1"))
Delattr(vm, k.key);
}
return SWIG_OK;
}