mirror of
https://github.com/gnustep/libs-base.git
synced 2025-04-22 16:33:29 +00:00
Remove handle from runloop when invalidating it.
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@6896 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
c0bd8bcbed
commit
c3b82eab0f
1 changed files with 17 additions and 2 deletions
|
@ -526,6 +526,8 @@ static Class runLoopClass;
|
|||
- (void) gcFinalize
|
||||
{
|
||||
[self invalidate];
|
||||
(void)close(desc);
|
||||
desc = -1;
|
||||
}
|
||||
|
||||
- (void) invalidate
|
||||
|
@ -533,9 +535,22 @@ static Class runLoopClass;
|
|||
DO_LOCK(myLock);
|
||||
if (valid == YES)
|
||||
{
|
||||
NSRunLoop *l;
|
||||
|
||||
valid = NO;
|
||||
(void)close(desc);
|
||||
desc = -1;
|
||||
l = [runLoopClass currentRunLoop];
|
||||
[l removeEvent: (void*)(gsaddr)desc
|
||||
type: ET_RDESC
|
||||
forMode: nil
|
||||
all: YES];
|
||||
[l removeEvent: (void*)(gsaddr)desc
|
||||
type: ET_WDESC
|
||||
forMode: nil
|
||||
all: YES];
|
||||
[l removeEvent: (void*)(gsaddr)desc
|
||||
type: ET_EDESC
|
||||
forMode: nil
|
||||
all: YES];
|
||||
NSDebugMLLog(@"GSTcpHandle", @"invalidated", 0);
|
||||
[[self recvPort] removeHandle: self];
|
||||
[[self sendPort] removeHandle: self];
|
||||
|
|
Loading…
Reference in a new issue