diff --git a/src/rostermanager.cpp b/src/rostermanager.cpp index 8a9db4606cf96e7fe4a277e120af68a483ea2e69..0690ced5456407666724ca92db51908141a9dae4 100644 --- a/src/rostermanager.cpp +++ b/src/rostermanager.cpp @@ -64,11 +64,14 @@ RosterManager::~RosterManager() { delete buddy; } - LOG4CXX_INFO(logger, "Removing " << m_requests.size() << " unresponded IQs"); - BOOST_FOREACH(Swift::SetRosterRequest::ref request, m_requests) { - request->onResponse.disconnect_all_slots(); + if (m_requests.size() != 0) { + LOG4CXX_INFO(logger, m_user->getJID().toString() << ": Removing " << m_requests.size() << " unresponded IQs"); + BOOST_FOREACH(Swift::SetRosterRequest::ref request, m_requests) { + request->onResponse.disconnect_all_slots(); + m_component->getIQRouter()->removeHandler(request); + } + m_requests.clear(); } - m_requests.clear(); boost::singleton_pool::release_memory();