mirror of
https://github.com/gnustep/libs-base.git
synced 2025-04-22 16:33:29 +00:00
Fix obscure memory management issues
This commit is contained in:
parent
1c2b81d724
commit
235bb21df3
3 changed files with 10 additions and 13 deletions
|
@ -237,21 +237,14 @@ static SEL objSel;
|
|||
|
||||
if (isProxy == YES)
|
||||
{
|
||||
k = [e nextObject];
|
||||
if (nil == (k = [e nextObject])) break;
|
||||
o = [other objectForKey: k];
|
||||
}
|
||||
else
|
||||
{
|
||||
k = (*nxtObj)(e, nxtSel);
|
||||
if (nil == (k = (*nxtObj)(e, nxtSel))) break;
|
||||
o = (*otherObj)(other, objSel, k);
|
||||
}
|
||||
k = [k copyWithZone: z];
|
||||
if (k == nil)
|
||||
{
|
||||
DESTROY(self);
|
||||
[NSException raise: NSInvalidArgumentException
|
||||
format: @"Tried to init dictionary with nil key"];
|
||||
}
|
||||
if (shouldCopy)
|
||||
{
|
||||
o = [o copyWithZone: z];
|
||||
|
@ -275,7 +268,8 @@ static SEL objSel;
|
|||
}
|
||||
else
|
||||
{
|
||||
GSIMapAddPairNoRetain(&map, (GSIMapKey)k, (GSIMapVal)o);
|
||||
GSIMapAddPair(&map, (GSIMapKey)k, (GSIMapVal)o);
|
||||
RELEASE(o);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -253,12 +253,15 @@ static NSMapTable *globalClassMap = 0;
|
|||
if (_delegate != nil)
|
||||
{
|
||||
r = [_delegate unarchiver: self didDecodeObject: o];
|
||||
if (r != o)
|
||||
/* Apple documentation says that the delegate may return nil to
|
||||
* indicate that the decoded objects should not be changed.
|
||||
*/
|
||||
if (r != nil && r != o)
|
||||
{
|
||||
[_delegate unarchiver: self
|
||||
willReplaceObject: o
|
||||
withObject: r];
|
||||
o = r;
|
||||
o = RETAIN(r);
|
||||
GSIArraySetItemAtIndex(_objMap, (GSIArrayItem)o, index);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1012,7 +1012,7 @@ NSLog(@"_processTag <%@%@ %@>", flag?@"/": @"", tag, attributes);
|
|||
}
|
||||
else
|
||||
{
|
||||
entity = @""; // not resolved
|
||||
ASSIGN(entity, @""); // not resolved
|
||||
}
|
||||
return entity;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue