Corrections for archiver issues.

git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@23203 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
Gregory John Casamento 2006-08-05 03:28:57 +00:00
parent 299b25f471
commit 540989b765
3 changed files with 20 additions and 4 deletions

View file

@ -1,3 +1,12 @@
2006-08-04 23:26-EDT Gregory John Casamento <greg_casamento@yahoo.com>
* Source/NSKeyedArchiver.m: in _encodeObject:forKey: use replacement
if it exists.
* Source/NSKeyedUnarchiver.m: in unarchiveObjectWithFile: remove
autorelease pool, since the unarchiveObjectWithData: object is
already autoreleased, this was causing a crash when unarchiving the
object.
2006-07-26 Richard Frith-Macdonald <rfm@gnu.org> 2006-07-26 Richard Frith-Macdonald <rfm@gnu.org>
* Source/Additions/GSMime.m: Remove a couple of comments * Source/Additions/GSMime.m: Remove a couple of comments

View file

@ -205,6 +205,13 @@ static NSDictionary *makeReference(unsigned ref)
} }
GSIMapAddPair(_repMap, (GSIMapKey)original, (GSIMapVal)anObject); GSIMapAddPair(_repMap, (GSIMapKey)original, (GSIMapVal)anObject);
} }
else
{
/*
* If the object has a replacement, use it.
*/
anObject = node->value.obj;
}
} }
if (anObject != nil) if (anObject != nil)
@ -237,7 +244,7 @@ static NSDictionary *makeReference(unsigned ref)
{ {
Class c = [anObject class]; Class c = [anObject class];
// FIXME ... exactly what classes are stored directly??? // FIXME ... exactly what classes are stored directly???
if ([anObject isKindOfClass: [GSString class]] == YES if ([anObject isKindOfClass: [GSString class]] == YES
|| c == [@"literal" class]) || c == [@"literal" class])
{ {

View file

@ -320,14 +320,14 @@ static NSMapTable globalClassMap = 0;
+ (id) unarchiveObjectWithFile: (NSString*)aPath + (id) unarchiveObjectWithFile: (NSString*)aPath
{ {
CREATE_AUTORELEASE_POOL(pool);
NSData *d; NSData *d;
id o; id o;
// CREATE_AUTORELEASE_POOL(pool);
d = [NSData dataWithContentsOfFile: aPath]; d = [NSData dataWithContentsOfFile: aPath];
o = [self unarchiveObjectWithData: d]; o = [self unarchiveObjectWithData: d];
RETAIN(o); // RETAIN(o);
RELEASE(pool); // RELEASE(pool);
return AUTORELEASE(o); return AUTORELEASE(o);
} }