diff options
author | Martin Sustrik <sustrik@250bpm.com> | 2010-09-01 18:42:15 +0200 |
---|---|---|
committer | Martin Sustrik <sustrik@250bpm.com> | 2010-09-01 18:42:15 +0200 |
commit | a81a37399b2ab4143aedf3ff4c442655b9e7e9b7 (patch) | |
tree | 984579dfe55d64dcfcf8ee8c124f053d778a262b /src | |
parent | 47aaf10211a0f3380dc82942a8cb4eba8c3c7ea3 (diff) | |
parent | 59315ebdcb565d23ba78ba0ca8581cef465fc9bd (diff) |
Merge branch 'maint'
* maint:
Erasure of retired fd's in select.cpp causes an assertion in MSVC 2008 STL
Diffstat (limited to 'src')
-rw-r--r-- | src/select.cpp | 11 |
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; |