fix close

This commit is contained in:
Looly 2021-08-16 22:48:59 +08:00
parent 3fe722554c
commit 6e871a1fae
2 changed files with 14 additions and 15 deletions

View File

@ -12,6 +12,7 @@
### 🐞Bug修复
* 【extra 】 修复TinyPinyinEngine空构造造成可能的误判问题
* 【http 】 修复在gzip模式下Content-Length服务端设置异常导致的阶段
* 【db 】 修复PooledDataSource关闭逻辑错误问题
-------------------------------------------------------------------------------------------------------------

View File

@ -147,11 +147,9 @@ public class PooledDataSource extends AbstractDataSource {
@Override
synchronized public void close() {
if (CollectionUtil.isNotEmpty(this.freePool)) {
for (PooledConnection pooledConnection : freePool) {
pooledConnection.release();
this.freePool.clear();
this.freePool = null;
}
this.freePool.forEach(PooledConnection::release);
this.freePool.clear();
this.freePool = null;
}
}