fix retain/release bug deserialising

git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@22968 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
Richard Frith-MacDonald 2006-05-22 09:57:21 +00:00
parent 390661c762
commit 8ad89b9941
2 changed files with 14 additions and 1 deletions

View file

@ -1,3 +1,10 @@
2006-05-22 Richard Frith-Macdonald <rfm@gnu.org>
Fix longstanding NSSerialiser deserialisation problem ... is not
retaining cross-referenced items... which is not a problem unless
the item happens to be a dictionary key which is copied/released
when the corresponding value is added to the dictionary.
2006-05-20 Richard Frith-Macdonald <rfm@gnu.org>
Restore reversions with a bugfix for deserialising ascii strings

View file

@ -670,7 +670,13 @@ deserializeFromInfo(_NSDeserializerInfo* info)
else
{
(*mdSetImp)(d, mdSetSel, o, k);
RELEASE(k);
/*
* Since a dictionary copies its keys rather
* than retaining them, we must autorelease
* rather than simply releasing as the key may
* be referred to by a cross-reference later.
*/
AUTORELEASE(k);
RELEASE(o);
}
}