Skip to content

Commit 9cd2166

Browse files
committed
Close sockets when the connection pool goes away.
1 parent e9f0507 commit 9cd2166

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

couchdb/http.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -479,6 +479,11 @@ def release(self, url, conn):
479479
finally:
480480
self.lock.release()
481481

482+
def __del__(self):
483+
for key, conns in list(self.conns.items()):
484+
for conn in conns:
485+
conn.close()
486+
482487

483488
class Resource(object):
484489

0 commit comments

Comments
 (0)