From 5ac81e93fb6cf44207071a63d6af2e06688954dc Mon Sep 17 00:00:00 2001 From: Carl Jackson Date: Fri, 16 May 2014 21:01:16 -0700 Subject: [PATCH] Reset cStack's C on release Previously, we would keep the URLParams / Env associated with a cStack around until the next request flushed them. However, this might cause either of these maps to stick around for much longer than they ought to, potentially keeping references to many, many objects. Instead, clear out the saved context on every release. --- web/middleware.go | 1 + 1 file changed, 1 insertion(+) diff --git a/web/middleware.go b/web/middleware.go index a8477c5..03e04e7 100644 --- a/web/middleware.go +++ b/web/middleware.go @@ -130,6 +130,7 @@ func (m *mStack) alloc() *cStack { } func (m *mStack) release(cs *cStack) { + cs.C = C{} if cs.pool != m.pool { return }