From 6ea7ddd7a047be9c07ae7c297d837fcdbd97590c Mon Sep 17 00:00:00 2001 From: Marcos Pinto Date: Sun, 17 Jun 2007 14:21:44 +0000 Subject: [PATCH] fixed mutex issue in disk io thread --- libtorrent/src/disk_io_thread.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/libtorrent/src/disk_io_thread.cpp b/libtorrent/src/disk_io_thread.cpp index 6f97ce7df..8e72ac684 100644 --- a/libtorrent/src/disk_io_thread.cpp +++ b/libtorrent/src/disk_io_thread.cpp @@ -234,8 +234,13 @@ namespace libtorrent try { if (handler) handler(ret, j); } catch (std::exception&) {} - if (j.buffer) m_pool.ordered_free(j.buffer); + if (j.buffer) + { + l.lock(); + m_pool.ordered_free(j.buffer); + } } } } +