Fix bug with return value of getNamespacedName()

We need to make a copy instead of directly returning whatever sym::name
points to, as this value can be overwritten with something different
later, resulting in weird problems with the value of "proxyname"
attribute changing "on its own".

After this bug fix, a few more unit tests pass.
This commit is contained in:
Vadim Zeitlin 2019-08-04 15:44:23 +02:00
commit cb3d9df000
2 changed files with 2 additions and 8 deletions

View file

@ -158,12 +158,11 @@ public:
// FIXME: using namespace as class name is a hack.
proxyname = Swig_name_member(NULL, nspace, symname);
} else {
proxyname = symname;
proxyname = Copy(symname);
}
Setattr(n, "proxyname", proxyname);
Delete(proxyname);
return Copy(proxyname);
return proxyname;
}
/* -----------------------------------------------------------------------------