diff --git a/src/disk_io_thread.cpp b/src/disk_io_thread.cpp index 6f97ce7df..5398d5ae8 100644 --- a/src/disk_io_thread.cpp +++ b/src/disk_io_thread.cpp @@ -234,7 +234,11 @@ 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); + } } } }