diff --git a/routes/middleware.py b/routes/middleware.py
index 649aa25..d06fd70 100644
--- a/routes/middleware.py
+++ b/routes/middleware.py
@@ -3,10 +3,12 @@ import re
import logging
from webob import Request
+from eventlet import greenthread
from routes.base import request_config
from routes.util import URLGenerator
+
log = logging.getLogger('routes.middleware')
@@ -155,6 +157,9 @@ class RoutesMiddleware(object):
# Wrapped in try as in rare cases the attribute will be gone already
try:
del self.mapper.environ
+ if self.singleton:
+ cur = greenthread.getcurrent()
+ del config._RequestConfig__shared_state._local__greens[cur]
except AttributeError:
pass
return response
diff --git a/routes/ middleware. py b/routes/ middleware. py middleware. py middleware. py
index 649aa25..d06fd70 100644
--- a/routes/
+++ b/routes/
@@ -3,10 +3,12 @@ import re
import logging
from webob import Request
+from eventlet import greenthread
from routes.base import request_config
from routes.util import URLGenerator
+ getLogger( 'routes. middleware' )
log = logging.
@@ -155,6 +157,9 @@ class RoutesMiddlewar e(object) : getcurrent( ) _RequestConfig_ _shared_ state._ local__ greens[ cur]
# Wrapped in try as in rare cases the attribute will be gone already
try:
del self.mapper.environ
+ if self.singleton:
+ cur = greenthread.
+ del config.
except AttributeError:
pass
return response