From bd1e9c8ca320bbbb1dbb7328ecb9edcc25c5ab9e Mon Sep 17 00:00:00 2001 From: Manolo Gouy Date: Tue, 31 May 2011 11:20:52 +0000 Subject: [PATCH] Fix STR #2652: Mac OS-specific bug in Fl::remove_fd(). git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3@8771 ea41ed52-d2ee-0310-a9c1-e6b18d33e121 --- src/Fl_cocoa.mm | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/Fl_cocoa.mm b/src/Fl_cocoa.mm index 0df97c934..c124db7db 100644 --- a/src/Fl_cocoa.mm +++ b/src/Fl_cocoa.mm @@ -238,7 +238,7 @@ public: pthread_mutex_init(&_datalock, NULL); FD_ZERO(&_fdsets[0]); FD_ZERO(&_fdsets[1]); FD_ZERO(&_fdsets[2]); _cancelpipe[0] = _cancelpipe[1] = 0; - _maxfd = 0; + _maxfd = -1; } ~DataReady() @@ -304,12 +304,14 @@ void DataReady::AddFD(int n, int events, void (*cb)(int, void*), void *v) void DataReady::RemoveFD(int n, int events) { int i,j; + _maxfd = -1; // recalculate maxfd on the fly for (i=j=0; i _maxfd) _maxfd = fds[i].fd; // move it down in the array if necessary: if (j