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); + } } } } +