Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(8)

Unified Diff: impl/memory/gkvlite_utils.go

Issue 2601513007: Remove SetFinalizer from impl/memory. (Closed)
Patch Set: Created 4 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « impl/memory/datastore_test.go ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: impl/memory/gkvlite_utils.go
diff --git a/impl/memory/gkvlite_utils.go b/impl/memory/gkvlite_utils.go
index dbdfe2ef9cf9c45093a45b44ee81546063a98bdd..190e62126e78cfed2443bc265212379e44bb5c8b 100644
--- a/impl/memory/gkvlite_utils.go
+++ b/impl/memory/gkvlite_utils.go
@@ -6,7 +6,6 @@ package memory
import (
"bytes"
- "runtime"
"github.com/luci/gae/service/datastore"
"github.com/luci/gkvlite"
@@ -125,9 +124,7 @@ func (ms *memStoreImpl) Snapshot() memStore {
if ms.ro {
return ms
}
- ret := ms.s.Snapshot()
- runtime.SetFinalizer(ret, func(s *gkvlite.Store) { go s.Close() })
- return &memStoreImpl{ret, true}
+ return &memStoreImpl{ms.s.Snapshot(), true}
}
func (ms *memStoreImpl) GetCollection(name string) memCollection {
« no previous file with comments | « impl/memory/datastore_test.go ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698