Commit ba74563e authored by Anjo Vahldiek's avatar Anjo Vahldiek
Browse files

updated fix

parent 5191362a
...@@ -349,13 +349,15 @@ tcpsconn::process_accept() ...@@ -349,13 +349,15 @@ tcpsconn::process_accept()
// garbage collect all dead connections with refcount of 1 // garbage collect all dead connections with refcount of 1
std::map<int, connection *>::iterator i; std::map<int, connection *>::iterator i;
for (i = conns_.begin(); i != conns_.end(); i++) { for (i = conns_.begin(); i != conns_.end(); ) {
if (i->second->isdead() && i->second->ref() == 1) { if (i->second->isdead() && i->second->ref() == 1) {
jsl_log(JSL_DBG_2, "accept_loop garbage collected fd=%d\n", jsl_log(JSL_DBG_2, "accept_loop garbage collected fd=%d\n",
i->second->channo()); i->second->channo());
i->second->decref(); i->second->decref();
conns_.erase(i); conns_.erase(i++);
} }
else
i++;
} }
conns_[ch->channo()] = ch; conns_[ch->channo()] = ch;
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment