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 c8a3424 commit 661f4b2Copy full SHA for 661f4b2
triedb/firewood/database.go
@@ -376,10 +376,15 @@ func (db *Database) Close() error {
376
db.proposalLock.Lock()
377
defer db.proposalLock.Unlock()
378
379
- // We don't need to explicitly dereference the proposals, since they will be cleaned up
380
- // within the firewood close method.
+ // before closing, we must deference any outstanding proposals to free the
+ // memory owned by firewood (outside of go's memory management)
381
+ for _, pCtx := range db.proposalTree.Children {
382
+ db.dereference(pCtx)
383
+ }
384
+
385
db.proposalMap = nil
386
db.proposalTree.Children = nil
387
388
// Close the database
389
return db.fwDisk.Close()
390
}
0 commit comments