From 50787837968e3a5e279a8a557daef5f342065c92 Mon Sep 17 00:00:00 2001 From: Marcelo Matus Date: Wed, 21 Jan 2004 01:04:50 +0000 Subject: [PATCH] better treatment of the '0' director methods case git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk/SWIG@5658 626c5289-ae23-0410-ae9c-e8d60b6d4f22 --- Source/Modules/lang.cxx | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/Source/Modules/lang.cxx b/Source/Modules/lang.cxx index 6d559d192..18d305498 100644 --- a/Source/Modules/lang.cxx +++ b/Source/Modules/lang.cxx @@ -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; }