| 94 | } |
| 95 | |
| 96 | ~ConnectionPool() |
| 97 | { |
| 98 | uint32_t n = m_Connections.Size(); |
| 99 | int in_use = 0; |
| 100 | for (uint32_t i = 0; i < n; ++i) { |
| 101 | Connection* c = &m_Connections[i]; |
| 102 | if (c->m_State == STATE_INUSE) { |
| 103 | in_use++; |
| 104 | } else if (c->m_State == STATE_CONNECTED) { |
| 105 | DoClose(this, c); |
| 106 | } |
| 107 | } |
| 108 | |
| 109 | if (in_use > 0) { |
| 110 | dmLogWarning("Leaking %d connections from connection pool", in_use); |
| 111 | } |
| 112 | |
| 113 | dmMutex::Delete(m_Mutex); |
| 114 | } |
| 115 | }; |
| 116 | |
| 117 | Result New(const Params* params, HPool* pool) |