From add42425be933f18594ca594e2f2813db2f0823e Mon Sep 17 00:00:00 2001 From: CaS Date: Fri, 19 Apr 2002 17:22:49 +0000 Subject: [PATCH] Minor fix for invalidation error. git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@13513 72102866-910b-0410-8b05-ffd578937521 --- ChangeLog | 3 +++ Source/GSTcpPort.m | 14 ++++++++++---- 2 files changed, 13 insertions(+), 4 deletions(-) diff --git a/ChangeLog b/ChangeLog index e268dcc3c..ca28742fa 100644 --- a/ChangeLog +++ b/ChangeLog @@ -2,6 +2,9 @@ * Tools/gdnc.m: If given -NSHost specification for the current host, ignore it and use the standard name. + * Source/GSTcpPort.m: ([-invalidate]) call superclass implementation + at end ... so handles can find this port when they are destroying + themselves. Reverses last change I made to this. 2002-04-18 Richard Frith-Macdonald diff --git a/Source/GSTcpPort.m b/Source/GSTcpPort.m index be938950e..f8025dc10 100644 --- a/Source/GSTcpPort.m +++ b/Source/GSTcpPort.m @@ -1769,8 +1769,6 @@ static Class tcpPortClass; NSArray *handleArray; unsigned i; - [super invalidate]; // Avoid recursive calls - [tcpPortLock lock]; thePorts = NSMapGet(tcpPortMap, (void*)(gsaddr)portNum); if (thePorts != 0) @@ -1794,9 +1792,17 @@ static Class tcpPortClass; [handle invalidate]; } - NSFreeMapTable(handles); - handles = 0; + /* + * We permit mutual recursive invalidation, so the handles map + * may already have been destroyed. + */ + if (handles != 0) + { + NSFreeMapTable(handles); + handles = 0; + } } + [super invalidate]; } DO_UNLOCK(myLock); }