Commit 1acac671 authored by Guido van Rossum's avatar Guido van Rossum

We saw a weird crash of a test run once in _update_cache() where

self._tbuf was unexpectedly None.  The only way this can happen is
when the storage is closed (probably by a different thread); close()
sets _tbuf to None.  It turns out that a TransactionBuffer instance
can safely be closed more than once, so there's no need to set _tbuf
to None in the close() method.
parent 2e37d93d
......@@ -266,9 +266,7 @@ class ClientStorage:
def close(self):
"""Storage API: finalize the storage, releasing external resources."""
if self._tbuf is not None:
self._tbuf.close()
self._tbuf = None
self._tbuf.close()
if self._cache is not None:
self._cache.close()
self._cache = None
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment