mirror of
https://github.com/gnustep/libs-base.git
synced 2025-04-23 00:41:02 +00:00
Fix error unarchiving self referential objects.
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@18494 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
2878a6472f
commit
43eff241a0
2 changed files with 11 additions and 1 deletions
|
@ -1,3 +1,8 @@
|
|||
2004-01-28 Richard Frith-Macdonald <rfm@gnu.org>
|
||||
|
||||
* Source/NSKeyedUnrchiver.m: Store objects in map while they are
|
||||
decoding themselves, s they can be self referential.
|
||||
|
||||
2004-01-27 Fred Kiefer <FredKiefer@gmx.de>
|
||||
|
||||
* Source/NSPropertyList.m (nodeToObject()): Fixed bug in handling
|
||||
|
|
|
@ -192,6 +192,8 @@ static NSMapTable globalClassMap = 0;
|
|||
_keyMap = obj; // Dictionary describing object
|
||||
|
||||
o = [c allocWithZone: _zone]; // Create instance.
|
||||
// Store object in map so that decoding of it cn be self refrential.
|
||||
GSIArraySetItemAtIndex(_objMap, (GSIArrayItem)o, index);
|
||||
r = [o initWithCoder: self];
|
||||
if (r != o)
|
||||
{
|
||||
|
@ -199,6 +201,7 @@ static NSMapTable globalClassMap = 0;
|
|||
willReplaceObject: o
|
||||
withObject: r];
|
||||
o = r;
|
||||
GSIArraySetItemAtIndex(_objMap, (GSIArrayItem)o, index);
|
||||
}
|
||||
r = [o awakeAfterUsingCoder: self];
|
||||
if (r != o)
|
||||
|
@ -207,6 +210,7 @@ static NSMapTable globalClassMap = 0;
|
|||
willReplaceObject: o
|
||||
withObject: r];
|
||||
o = r;
|
||||
GSIArraySetItemAtIndex(_objMap, (GSIArrayItem)o, index);
|
||||
}
|
||||
|
||||
if (_delegate != nil)
|
||||
|
@ -218,6 +222,7 @@ static NSMapTable globalClassMap = 0;
|
|||
willReplaceObject: o
|
||||
withObject: r];
|
||||
o = r;
|
||||
GSIArraySetItemAtIndex(_objMap, (GSIArrayItem)o, index);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -236,9 +241,9 @@ static NSMapTable globalClassMap = 0;
|
|||
else
|
||||
{
|
||||
RETAIN(obj); // Use the decoded object directly
|
||||
GSIArraySetItemAtIndex(_objMap, (GSIArrayItem)obj, index);
|
||||
}
|
||||
|
||||
GSIArraySetItemAtIndex(_objMap, (GSIArrayItem)obj, index);
|
||||
return obj;
|
||||
}
|
||||
@end
|
||||
|
|
Loading…
Reference in a new issue