From 8495026156405d68a4bd7db2ca9b291846c0765a Mon Sep 17 00:00:00 2001 From: Patrick Mylund Nielsen Date: Fri, 22 Jun 2012 03:44:04 +0100 Subject: [PATCH] c can be collected. It isn't necessarily (right after) --- cache.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cache.go b/cache.go index f3740fe..4f21457 100644 --- a/cache.go +++ b/cache.go @@ -308,7 +308,7 @@ func New(de, ci time.Duration) *Cache { // This trick ensures that the janitor goroutine (which--granted it was enabled--is // running DeleteExpired on c forever) does not keep the returned C object from being // garbage collected. When it is garbage collected, the finalizer stops the janitor - // goroutine, after which c is collected. + // goroutine, after which c can be collected. C := &Cache{c} if ci > 0 { runtime.SetFinalizer(C, stopJanitor)