summaryrefslogtreecommitdiff
path: root/src/select.cpp
diff options
context:
space:
mode:
authorMartin Sustrik <sustrik@250bpm.com>2010-09-01 18:42:15 +0200
committerMartin Sustrik <sustrik@250bpm.com>2010-09-01 18:42:15 +0200
commita81a37399b2ab4143aedf3ff4c442655b9e7e9b7 (patch)
tree984579dfe55d64dcfcf8ee8c124f053d778a262b /src/select.cpp
parent47aaf10211a0f3380dc82942a8cb4eba8c3c7ea3 (diff)
parent59315ebdcb565d23ba78ba0ca8581cef465fc9bd (diff)
Merge branch 'maint'
* maint: Erasure of retired fd's in select.cpp causes an assertion in MSVC 2008 STL
Diffstat (limited to 'src/select.cpp')
-rw-r--r--src/select.cpp11
1 files changed, 7 insertions, 4 deletions
diff --git a/src/select.cpp b/src/select.cpp
index be5cd47..7345cbb 100644
--- a/src/select.cpp
+++ b/src/select.cpp
@@ -217,10 +217,13 @@ void zmq::select_t::loop ()
// Destroy retired event sources.
if (retired) {
- for (fd_set_t::size_type i = 0; i < fds.size (); i ++) {
- if (fds [i].fd == retired_fd) {
- fds.erase (fds.begin () + i);
- i --;
+ fd_set_t::iterator it = fds.begin();
+ while (it != fds.end()) {
+ if (it->fd == retired_fd) {
+ it = fds.erase(it);
+ }
+ else {
+ it++;
}
}
retired = false;