Memory leak fix in some of the scripting language modules when using default arguments in constructors. The scripting language was not taking ownership of the C++ object memory when any of the constructors that use default arguments was called.

git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@6969 626c5289-ae23-0410-ae9c-e8d60b6d4f22
This commit is contained in:
William S Fulton 2005-02-17 22:19:16 +00:00
commit d02743af6d

View file

@ -1188,6 +1188,10 @@ static void default_arguments(Node *n) {
if (templatetype) Setattr(new_function,"templatetype",Copy(templatetype));
if (symtypename) Setattr(new_function,"sym:typename",Copy(symtypename));
if (templateparms) Setattr(new_function,"templateparms",CopyParmList(templateparms));
} else if (Strcmp(nodeType(function),"constructor") == 0) {
/* only copied for constructors as this is not a user defined feature - it is hard coded in the parser */
Node *featurenew = Getattr(function,"feature:new");
if (featurenew) Setattr(new_function,"feature:new",Copy(featurenew));
}
add_symbols(new_function);