Fix crasher if stream is opened more than once.

git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@38841 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
Richard Frith-MacDonald 2015-07-27 09:50:15 +00:00
parent 14d22790b6
commit d1ea6cd995
2 changed files with 10 additions and 1 deletions

View file

@ -1,3 +1,8 @@
2015-07-27 Richard Frith-Macdonald <rfm@gnu.org>
* Source/GSStream.m: Fix failure to unschedule from run loop if a
stream is opened more than once.
2015-07-24 Richard Frith-Macdonald <rfm@gnu.org>
* Headers/GNUstepBase/GSIMap.h: add GSI_MAP_TABLE_S

View file

@ -125,10 +125,14 @@ static RunLoopEventType typeForStream(NSStream *aStream)
- (void) removeStream: (NSStream*)aStream mode: (NSString*)mode
{
/* We may have added the stream more than once (eg if the stream -open
* method was called more than once, so we need to remove all event
* registrations.
*/
[self removeEvent: [aStream _loopID]
type: typeForStream(aStream)
forMode: mode
all: NO];
all: YES];
}
@end