Break up a circular dependency on shutdown

This commit is contained in:
Armin Ronacher 2011-11-05 17:43:40 +01:00
parent 11c7b1df23
commit 7f4c12b335
3 changed files with 93 additions and 0 deletions

View file

@ -150,6 +150,10 @@ class RequestContext(object):
assert rv is self, 'Popped wrong request context. (%r instead of %r)' \
% (rv, self)
# get rid of circular dependencies at the end of the request
# so that we don't require the GC to be active.
rv.request.environ['werkzeug.request'] = None
def __enter__(self):
self.push()
return self