Commit 4a1f099f 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 70a17a06
...@@ -266,9 +266,7 @@ class ClientStorage: ...@@ -266,9 +266,7 @@ class ClientStorage:
def close(self): def close(self):
"""Storage API: finalize the storage, releasing external resources.""" """Storage API: finalize the storage, releasing external resources."""
if self._tbuf is not None:
self._tbuf.close() self._tbuf.close()
self._tbuf = None
if self._cache is not None: if self._cache is not None:
self._cache.close() self._cache.close()
self._cache = None 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