diff --git a/beets/dbcore/db.py b/beets/dbcore/db.py index d1f91389f..2745ea4c6 100644 --- a/beets/dbcore/db.py +++ b/beets/dbcore/db.py @@ -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):