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

View File

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