From f1f6064a73ab71907d906af8ece3be9d33f594cc Mon Sep 17 00:00:00 2001 From: richard Date: Sun, 23 May 1999 19:17:10 +0000 Subject: [PATCH] descriptor leakage fix. git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@4282 72102866-910b-0410-8b05-ffd578937521 --- ChangeLog | 5 +++++ Source/TcpPort.m | 7 +++---- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/ChangeLog b/ChangeLog index 9270b5bde..278d5a452 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +Sun May 23 20:38:00 1999 Richard Frith-Macdonald + + * Source/TcpPort.m: Fixed retain/release loop causing ports occasionally + to be kept in existence when they should disappear. + Fri May 21 19:35:00 1999 Richard Frith-Macdonald * Source/include/NSObject.h: Added NSExtraRefCount() diff --git a/Source/TcpPort.m b/Source/TcpPort.m index 942a43d39..a8794fd01 100644 --- a/Source/TcpPort.m +++ b/Source/TcpPort.m @@ -1369,7 +1369,6 @@ static NSMapTable* port_number_2_port; peeraddr: &clientname inPort: self]; [self _addClientOutPort: op]; - [op release]; if (debug_tcp_port) NSLog(@"%s: Accepted connection from\n %@.\n", object_get_class_name (self), [op description]); @@ -1377,6 +1376,7 @@ static NSMapTable* port_number_2_port; postNotificationName: InPortAcceptedClientNotification object: self userInfo: op]; + [op release]; } else { @@ -1862,7 +1862,7 @@ static NSMapTable *out_port_bag = NULL; /* Register which InPort object will listen to replies from our messages. This may be nil, in which case it can get set later in -sendPacket... */ - p->_polling_in_port = [ip retain]; + p->_polling_in_port = ip; /* Set the port's address. */ if (sockaddr) @@ -2029,7 +2029,7 @@ static NSMapTable *out_port_bag = NULL; restriction; see the note about them at the top of this file. */ if (_polling_in_port == nil && reply_port != nil) { - _polling_in_port = [reply_port retain]; + _polling_in_port = reply_port; [_polling_in_port _addClientOutPort: self]; } else if (_polling_in_port != reply_port) @@ -2106,7 +2106,6 @@ static NSMapTable *out_port_bag = NULL; } [port _connectedOutPortInvalidated: self]; - [port release]; } }