fix many/many memory leaks
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk/SWIG@7904 626c5289-ae23-0410-ae9c-e8d60b6d4f22
This commit is contained in:
parent
fff0f6007b
commit
645f95d633
23 changed files with 627 additions and 251 deletions
|
|
@ -537,10 +537,13 @@ Swig_name_object_inherit(Hash *namehash, String *base, String *derived) {
|
|||
if (!newh) {
|
||||
newh = NewHash();
|
||||
Setattr(namehash,nkey,newh);
|
||||
Delete(newh);
|
||||
}
|
||||
for (oi = First(n); oi.key; oi = Next(oi)) {
|
||||
if (!Getattr(newh,oi.key)) {
|
||||
Setattr(newh,oi.key,Copy(oi.item));
|
||||
String *ci = Copy(oi.item);
|
||||
Setattr(newh,oi.key,ci);
|
||||
Delete(ci);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -700,8 +703,10 @@ Swig_feature_set(Hash *features, const String_or_char *name, SwigType *decl, con
|
|||
} else {
|
||||
fhash = Getattr(n,decl);
|
||||
if (!fhash) {
|
||||
String *cdecl = Copy(decl);
|
||||
fhash = NewHash();
|
||||
Setattr(n,Copy(decl),fhash);
|
||||
Setattr(n,cdecl,fhash);
|
||||
Delete(cdecl);
|
||||
Delete(fhash);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue