DO patch from Richard Frith-MacDonald <richard@brainstorm.co.uk>

git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@2410 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
fedor 1997-09-09 15:30:24 +00:00
parent 0bcb15c30f
commit c34b6ac390
9 changed files with 384 additions and 149 deletions

View file

@ -699,7 +699,7 @@ static NSMapTable* port_number_2_port;
if ((p = (id) NSMapGet (port_number_2_port, (void*)((int)n))))
{
assert (p->is_valid);
return p;
return [p retain];
}
/* There isn't already a TcpInPort for this port number, so create
@ -878,6 +878,7 @@ static NSMapTable* port_number_2_port;
want to wait for one directly from a port, you can use this method. */
- newPacketReceivedBeforeDate: date
{
NSString* saved_mode = [NSRunLoop currentMode];
id saved_packet_invocation;
id packet = nil;
id handle_packet (id p)
@ -894,7 +895,7 @@ static NSMapTable* port_number_2_port;
/* Make sure we're in the run loop, and run it, waiting for the
incoming packet. */
[[NSRunLoop currentRunLoop] addPort: self
forMode: [NSRunLoop currentMode]];
forMode: saved_mode];
while ([NSRunLoop runOnceBeforeDate: date]
&& !packet)
;
@ -904,7 +905,7 @@ static NSMapTable* port_number_2_port;
this run loop. */
_packet_invocation = saved_packet_invocation;
[[NSRunLoop currentRunLoop] removePort: self
forMode: [NSRunLoop currentMode]];
forMode: saved_mode];
return packet;
}
@ -1347,7 +1348,7 @@ static NSMapTable *out_port_bag = NULL;
work because sin_zero's may differ. */
{
assert (p->is_valid);
return p;
return [p retain];
}
}
}
@ -1681,8 +1682,7 @@ static NSMapTable *out_port_bag = NULL;
- (void) dealloc
{
if (is_valid)
[self invalidate];
[self invalidate];
[super dealloc];
}