From: Adam Dickmeiss Date: Tue, 3 Jun 2014 13:38:19 +0000 (+0200) Subject: session_shared: close in ~BackendInstance MP-549 X-Git-Tag: v1.5.3~1 X-Git-Url: http://lists.indexdata.dk/?a=commitdiff_plain;h=4efeeb4bbff6c9b8eb4177fbe268ac240e8ca4e6;p=metaproxy-moved-to-github.git session_shared: close in ~BackendInstance MP-549 --- diff --git a/src/filter_session_shared.cpp b/src/filter_session_shared.cpp index eb8b23a..099b47f 100644 --- a/src/filter_session_shared.cpp +++ b/src/filter_session_shared.cpp @@ -371,6 +371,14 @@ void yf::SessionShared::BackendInstance::timestamp() yf::SessionShared::BackendInstance::~BackendInstance() { + if (m_close_package) + { + mp::odr odr; + m_close_package->response() = odr.create_close( + 0, Z_Close_lackOfActivity, 0); + m_close_package->session().close(); + m_close_package->move(); + } delete m_close_package; } @@ -1216,12 +1224,6 @@ bool yf::SessionShared::BackendClass::expire_instances() } else if (now < last_use || now - last_use > m_backend_expiry_ttl) { - mp::odr odr; - (*bit)->m_close_package->response() = odr.create_close( - 0, Z_Close_lackOfActivity, 0); - (*bit)->m_close_package->session().close(); - (*bit)->m_close_package->move(); - bit = m_backend_list.erase(bit); } else