From 3afb10b9bd36b89cbd454acfd4d87a146dc98223 Mon Sep 17 00:00:00 2001 From: CaS Date: Wed, 20 Mar 2002 12:13:03 +0000 Subject: [PATCH] Tidied. git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@13168 72102866-910b-0410-8b05-ffd578937521 --- Source/GSTcpPort.m | 17 ++++++++++------- Source/NSRunLoop.m | 15 ++++++++++++--- 2 files changed, 22 insertions(+), 10 deletions(-) diff --git a/Source/GSTcpPort.m b/Source/GSTcpPort.m index 6f2b6465d..5bf315334 100644 --- a/Source/GSTcpPort.m +++ b/Source/GSTcpPort.m @@ -1768,16 +1768,19 @@ static Class tcpPortClass; } [tcpPortLock unlock]; - handleArray = NSAllMapTableValues(handles); - i = [handleArray count]; - while (i-- > 0) + if (handles != 0) { - GSTcpHandle *handle = [handleArray objectAtIndex: i]; + handleArray = NSAllMapTableValues(handles); + i = [handleArray count]; + while (i-- > 0) + { + GSTcpHandle *handle = [handleArray objectAtIndex: i]; - [handle invalidate]; + [handle invalidate]; + } + NSFreeMapTable(handles); + handles = 0; } - NSFreeMapTable(handles); - handles = 0; [super invalidate]; } DO_UNLOCK(myLock); diff --git a/Source/NSRunLoop.m b/Source/NSRunLoop.m index 5b25d047b..46807d5d2 100644 --- a/Source/NSRunLoop.m +++ b/Source/NSRunLoop.m @@ -419,9 +419,18 @@ const NSMapTableValueCallBacks ArrayMapValueCallBacks = NSZoneFree(timers->zone, (void*)timers); GSIArrayEmpty(watchers); NSZoneFree(watchers->zone, (void*)watchers); - NSFreeMapTable(_efdMap); - NSFreeMapTable(_rfdMap); - NSFreeMapTable(_wfdMap); + if (_efdMap != 0) + { + NSFreeMapTable(_efdMap); + } + if (_rfdMap != 0) + { + NSFreeMapTable(_rfdMap); + } + if (_wfdMap != 0) + { + NSFreeMapTable(_wfdMap); + } #if HAVE_POLL if (pollfds != 0) {