diff --git a/source/vibe/core/connectionpool.d b/source/vibe/core/connectionpool.d index 373a024..ce13b3b 100644 --- a/source/vibe/core/connectionpool.d +++ b/source/vibe/core/connectionpool.d @@ -74,6 +74,8 @@ final class ConnectionPool(Connection) debug assert(m_thread is () @trusted { return Thread.getThis(); } (), "ConnectionPool was called from a foreign thread!"); () @trusted { m_sem.lock(); } (); + scope (failure) () @trusted { m_sem.unlock(); } (); + size_t cidx = size_t.max; foreach( i, c; m_connections ){ auto plc = c in m_lockCount;