Skip to content

Commit 02f2cc5

Browse files
committed
Fix #1920 (port #1918)
1 parent 044717b commit 02f2cc5

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/main/java/redis/clients/jedis/Jedis.java

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3629,10 +3629,12 @@ public Map<String, String> pubsubNumSub(String... channels) {
36293629
@Override
36303630
public void close() {
36313631
if (dataSource != null) {
3632+
Pool<Jedis> pool = this.dataSource;
3633+
this.dataSource = null;
36323634
if (client.isBroken()) {
3633-
this.dataSource.returnBrokenResource(this);
3635+
pool.returnBrokenResource(this);
36343636
} else {
3635-
this.dataSource.returnResource(this);
3637+
pool.returnResource(this);
36363638
}
36373639
this.dataSource = null;
36383640
} else {

0 commit comments

Comments
 (0)