close file properly

git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@23235 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
Richard Frith-MacDonald 2006-08-09 14:21:39 +00:00
parent 06d6fd8a98
commit d11ec51c18

View file

@ -253,9 +253,15 @@ static void setNonblocking(SOCKET fd)
- (void) close
{
if (CloseHandle((HANDLE)_loopID) == 0)
[self _recordError];
if (_loopID != INVALID_HANDLE_VALUE)
{
if (CloseHandle((HANDLE)_loopID) == 0)
{
[self _recordError];
}
}
[super close];
_loopID = (void*)INVALID_HANDLE_VALUE;
}
- (void) dealloc
@ -880,6 +886,18 @@ else NSLog(@"EVENTS:%x", events.lNetworkEvents);
@implementation GSFileOutputStream
- (void) close
{
if (_loopID != INVALID_HANDLE_VALUE)
{
if (CloseHandle((HANDLE)_loopID) == 0)
{
[self _recordError];
}
}
[super close];
_loopID = (void*)INVALID_HANDLE_VALUE;
}
- (void) dealloc
{