From da9a5c4262022cb540ffcd49e8285bf7dff68353 Mon Sep 17 00:00:00 2001 From: Arvid Norberg Date: Sat, 1 Nov 2008 09:02:13 +0000 Subject: [PATCH] connection_queue::close() fix --- src/connection_queue.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/connection_queue.cpp b/src/connection_queue.cpp index 661bb7656..220637409 100644 --- a/src/connection_queue.cpp +++ b/src/connection_queue.cpp @@ -123,10 +123,11 @@ namespace libtorrent { // we don't want to call the timeout callback while we're locked // since that is a recepie for dead-locks - l.unlock(); - try { m_queue.front().on_timeout(); } catch (std::exception&) {} - l.lock(); + entry e = m_queue.front(); m_queue.pop_front(); + l.unlock(); + try { e.on_timeout(); } catch (std::exception&) {} + l.lock(); } }