We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 8dfd30f commit 1cd0048Copy full SHA for 1cd0048
accounts/keystore/keystore.go
@@ -99,9 +99,10 @@ func (ks *KeyStore) init(keydir string) {
99
// TODO: In order for this finalizer to work, there must be no references
100
// to ks. addressCache doesn't keep a reference but unlocked keys do,
101
// so the finalizer will not trigger until all timed unlocks have expired.
102
- runtime.SetFinalizer(ks, func(m *KeyStore) {
103
- m.cache.close()
104
- })
+ runtime.AddCleanup(ks, func(c *accountCache) {
+ c.close()
+ }, ks.cache)
105
+
106
// Create the initial list of wallets from the cache
107
accs := ks.cache.accounts()
108
ks.wallets = make([]accounts.Wallet, len(accs))
0 commit comments