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 5e785ce commit 224d7c9Copy full SHA for 224d7c9
triedb/firewood/database.go
@@ -378,10 +378,15 @@ func (db *Database) Close() error {
378
db.proposalLock.Lock()
379
defer db.proposalLock.Unlock()
380
381
- // We don't need to explicitly dereference the proposals, since they will be cleaned up
382
- // 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)
383
+ for _, pCtx := range db.proposalTree.Children {
384
+ db.dereference(pCtx)
385
+ }
386
+
387
db.proposalMap = nil
388
db.proposalTree.Children = nil
389
390
// Close the database
391
return db.fwDisk.Close()
392
}
0 commit comments