summaryrefslogtreecommitdiff
path: root/src/socketengines/socketengine_epoll.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/socketengines/socketengine_epoll.cpp')
-rw-r--r--src/socketengines/socketengine_epoll.cpp8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/socketengines/socketengine_epoll.cpp b/src/socketengines/socketengine_epoll.cpp
index 316696f54..ad9bef3ce 100644
--- a/src/socketengines/socketengine_epoll.cpp
+++ b/src/socketengines/socketengine_epoll.cpp
@@ -32,8 +32,12 @@ void SocketEngine::Shutdown()
{
Process();
- for (std::map<int, Socket *>::const_iterator it = Sockets.begin(), it_end = Sockets.end(); it != it_end; ++it)
- delete it->second;
+ for (std::map<int, Socket *>::const_iterator it = Sockets.begin(), it_end = Sockets.end(); it != it_end;)
+ {
+ Socket *s = it->second;
+ ++it;
+ delete s;
+ }
Sockets.clear();
delete [] events;