Memory leak and other fixes from Frith-MacDonald.

git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@2775 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
fedor 1998-03-12 14:21:20 +00:00
parent 7285b3e9a6
commit a0993c655f
17 changed files with 11155 additions and 10927 deletions

View file

@ -224,22 +224,32 @@ static NSMutableDictionary *_hostCache = nil;
[super encodeWithCoder: aCoder];
[aCoder encodeObject: [self address]];
}
#if 1
/* GNUstep specific method for more efficient decoding. */
+ (id) newWithCoder: (NSCoder*)aCoder
{
NSString *address = [aCoder decodeObject];
return [NSHost hostWithAddress: address];
}
/* OpenStep method for decoding (not used) */
#else
/* OpenStep methods for decoding (not used) */
- (id) awakeAfterUsingCoder: (NSCoder*)aCoder
{
return [NSHost hostWithAddress: [addresses objectAtIndex: 0]];
}
- (id) initWithCoder: (NSCoder*)aCoder
{
NSString *address;
[super initWithCoder: aCoder];
address = [aCoder decodeObject];
[self dealloc];
return [NSHost hostWithAddress: address];
addresses = [NSArray arrayWithObject: address];
[address release];
return self;
}
#endif
- (BOOL)isEqualToHost:(NSHost *)aHost
{