From ab720a6f1e375b9a79d32e8dec013c64deabff20 Mon Sep 17 00:00:00 2001 From: Adam Ierymenko Date: Fri, 5 Jun 2015 13:48:33 -0700 Subject: [PATCH] Fix for poll() in Phy<> with no sockets open. Only affects tcp-proxy. --- osdep/Phy.hpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/osdep/Phy.hpp b/osdep/Phy.hpp index 23fd2ee24..02ea56f90 100644 --- a/osdep/Phy.hpp +++ b/osdep/Phy.hpp @@ -620,7 +620,7 @@ public: #endif } - bool atEnd = false; + bool atEnd = _socks.empty(); for(typename std::list::iterator s(_socks.begin()),nexts;(!atEnd);s=nexts) { nexts = s; ++nexts; // we can delete the linked list item, so traverse now atEnd = (nexts == _socks.end()); // if we delete the last element, s!=_socks.end() will no longer terminate our loop