We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 30d891f commit 5c612c4Copy full SHA for 5c612c4
asgiref/local.py
@@ -84,7 +84,7 @@ def _get_storage(self):
84
self._context_refs.add(context_obj)
85
return getattr(context_obj, self._attr_name)
86
87
- def __del__(self):
+ def clear(self):
88
try:
89
for context_obj in self._context_refs:
90
@@ -96,6 +96,9 @@ def __del__(self):
96
# to _IterationGuard being None.
97
pass
98
99
+ def __del__(self):
100
+ self.clear()
101
+
102
def __getattr__(self, key):
103
with self._thread_lock:
104
storage = self._get_storage()
0 commit comments