Always remove stream from runloop when unscheduling, whether open or not.

git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@24964 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
rfm 2007-04-04 11:05:15 +00:00
parent 3f7e68d6fc
commit b10a971d04

View file

@ -228,10 +228,7 @@ static RunLoopEventType typeForStream(NSStream *aStream)
{
if ([_modes containsObject: mode])
{
if ([self _isOpened])
{
[_runloop removeStream: self mode: mode];
}
[_runloop removeStream: self mode: mode];
[_modes removeObject: mode];
if ([_modes count] == 0)
{
@ -251,6 +248,10 @@ static RunLoopEventType typeForStream(NSStream *aStream)
mode = [mode copy];
[_modes addObject: mode];
RELEASE(mode);
/* We only add open streams to the runloop .. subclasses may add
* streams when they are in the process of opening if they need
* to do so.
*/
if ([self _isOpened])
{
[_runloop addStream: self mode: mode];