From 4efeeb4bbff6c9b8eb4177fbe268ac240e8ca4e6 Mon Sep 17 00:00:00 2001 From: Adam Dickmeiss Date: Tue, 3 Jun 2014 15:38:19 +0200 Subject: [PATCH] session_shared: close in ~BackendInstance MP-549 --- src/filter_session_shared.cpp | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) 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 -- 1.7.10.4