mirror of
https://github.com/gnustep/libs-base.git
synced 2025-04-25 09:41:15 +00:00
Temporary rollback of fix to NSUnarchiver.
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@19073 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
03a934e274
commit
52548106c3
2 changed files with 9 additions and 29 deletions
|
@ -1,3 +1,7 @@
|
||||||
|
2004-04-09 Gregory John Casamento <greg_casamento@yahoo.com>
|
||||||
|
|
||||||
|
* Source/NSUnarchiver.m: Temporary rollback of previous fix.
|
||||||
|
|
||||||
2004-04-09 Richard Frith-Macdonald <rfm@gnu.org>
|
2004-04-09 Richard Frith-Macdonald <rfm@gnu.org>
|
||||||
|
|
||||||
* Source/NSUnarchiver.m: Retain objects while they are being
|
* Source/NSUnarchiver.m: Retain objects while they are being
|
||||||
|
|
|
@ -395,14 +395,8 @@ static Class NSDataMallocClass;
|
||||||
if (clsMap)
|
if (clsMap)
|
||||||
{
|
{
|
||||||
NSZone *z = clsMap->zone;
|
NSZone *z = clsMap->zone;
|
||||||
unsigned i;
|
|
||||||
|
|
||||||
GSIArrayClear(clsMap);
|
GSIArrayClear(clsMap);
|
||||||
i = GSIArrayCount(objMap);
|
|
||||||
while (i-- > 0)
|
|
||||||
{
|
|
||||||
RELEASE(GSIArrayItemAtIndex(objMap, i).obj);
|
|
||||||
}
|
|
||||||
GSIArrayClear(objMap);
|
GSIArrayClear(objMap);
|
||||||
GSIArrayClear(ptrMap);
|
GSIArrayClear(ptrMap);
|
||||||
NSZoneFree(z, (void*)clsMap);
|
NSZoneFree(z, (void*)clsMap);
|
||||||
|
@ -410,17 +404,10 @@ static Class NSDataMallocClass;
|
||||||
[super dealloc];
|
[super dealloc];
|
||||||
}
|
}
|
||||||
|
|
||||||
- (id) init
|
|
||||||
{
|
|
||||||
self = [self initForReadingWithData: nil];
|
|
||||||
return self;
|
|
||||||
}
|
|
||||||
|
|
||||||
- (id) initForReadingWithData: (NSData*)anObject
|
- (id) initForReadingWithData: (NSData*)anObject
|
||||||
{
|
{
|
||||||
if (anObject == nil)
|
if (anObject == nil)
|
||||||
{
|
{
|
||||||
DESTROY(self);
|
|
||||||
[NSException raise: NSInvalidArgumentException
|
[NSException raise: NSInvalidArgumentException
|
||||||
format: @"nil data passed to initForReadingWithData:"];
|
format: @"nil data passed to initForReadingWithData:"];
|
||||||
}
|
}
|
||||||
|
@ -607,25 +594,19 @@ static Class NSDataMallocClass;
|
||||||
format: @"decoded nil class"];
|
format: @"decoded nil class"];
|
||||||
}
|
}
|
||||||
obj = [c allocWithZone: zone];
|
obj = [c allocWithZone: zone];
|
||||||
/*
|
|
||||||
* The objMap array does not retain its contents directly,
|
|
||||||
* so we perform explicit retain/release as we add objects
|
|
||||||
* to and remove objects from the array.
|
|
||||||
*/
|
|
||||||
RETAIN(obj);
|
|
||||||
GSIArrayAddItem(objMap, (GSIArrayItem)obj);
|
GSIArrayAddItem(objMap, (GSIArrayItem)obj);
|
||||||
|
|
||||||
rep = [obj initWithCoder: self];
|
rep = [obj initWithCoder: self];
|
||||||
if (rep != obj)
|
if (rep != obj)
|
||||||
{
|
{
|
||||||
ASSIGN(obj, rep);
|
obj = rep;
|
||||||
GSIArraySetItemAtIndex(objMap, (GSIArrayItem)obj, xref);
|
GSIArraySetItemAtIndex(objMap, (GSIArrayItem)obj, xref);
|
||||||
}
|
}
|
||||||
|
|
||||||
rep = [obj awakeAfterUsingCoder: self];
|
rep = [obj awakeAfterUsingCoder: self];
|
||||||
if (rep != obj)
|
if (rep != obj)
|
||||||
{
|
{
|
||||||
ASSIGN(obj, rep);
|
obj = rep;
|
||||||
GSIArraySetItemAtIndex(objMap, (GSIArrayItem)obj, xref);
|
GSIArraySetItemAtIndex(objMap, (GSIArrayItem)obj, xref);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1180,16 +1161,11 @@ static Class NSDataMallocClass;
|
||||||
|
|
||||||
if (replacement == anObject)
|
if (replacement == anObject)
|
||||||
return;
|
return;
|
||||||
i = GSIArrayCount(objMap);
|
for (i = GSIArrayCount(objMap) - 1; i > 0; i--)
|
||||||
while (i-- > 0)
|
|
||||||
{
|
{
|
||||||
id old = GSIArrayItemAtIndex(objMap, i).obj;
|
if (GSIArrayItemAtIndex(objMap, i).obj == anObject)
|
||||||
|
|
||||||
if (old == anObject)
|
|
||||||
{
|
{
|
||||||
GSIArraySetItemAtIndex(objMap, (GSIArrayItem)replacement, i);
|
GSIArraySetItemAtIndex(objMap, (GSIArrayItem)replacement, i);
|
||||||
RETAIN(replacement);
|
|
||||||
RELEASE(old);
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1279,7 +1255,7 @@ static Class NSDataMallocClass;
|
||||||
|
|
||||||
objMap = &clsMap[1];
|
objMap = &clsMap[1];
|
||||||
GSIArrayInitWithZoneAndCapacity(objMap, zone, sizeO);
|
GSIArrayInitWithZoneAndCapacity(objMap, zone, sizeO);
|
||||||
GSIArrayAddItem(objMap, (GSIArrayItem)(void*)nil);
|
GSIArrayAddItem(objMap, (GSIArrayItem)(void*)0);
|
||||||
|
|
||||||
ptrMap = &clsMap[2];
|
ptrMap = &clsMap[2];
|
||||||
GSIArrayInitWithZoneAndCapacity(ptrMap, zone, sizeP);
|
GSIArrayInitWithZoneAndCapacity(ptrMap, zone, sizeP);
|
||||||
|
|
Loading…
Reference in a new issue