mirror of
https://github.com/gnustep/libs-base.git
synced 2025-04-23 00:41:02 +00:00
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:
parent
3f7e68d6fc
commit
b10a971d04
1 changed files with 5 additions and 4 deletions
|
@ -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];
|
||||
|
|
Loading…
Reference in a new issue