Close all threads' connections

This commit is contained in:
Adrian Sampson 2016-06-05 12:14:50 -07:00
parent 574f3bc732
commit f1b81bc60c

View file

@ -734,14 +734,11 @@ class Database(object):
return conn
def _close(self):
"""Close the current thread's connection to the underlying
SQLite database.
"""Close the all connections to the underlying SQLite database.
"""
thread_id = threading.current_thread().ident
with self._shared_map_lock:
if thread_id in self._connections:
self._connections[thread_id].close()
del self._connections[thread_id]
self._connections.clear()
@contextlib.contextmanager
def _tx_stack(self):