Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 7 additions & 2 deletions triedb/firewood/database.go
Original file line number Diff line number Diff line change
Expand Up @@ -376,10 +376,15 @@ func (db *Database) Close() error {
db.proposalLock.Lock()
defer db.proposalLock.Unlock()

// We don't need to explicitly dereference the proposals, since they will be cleaned up
// 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)
for _, pCtx := range db.proposalTree.Children {
db.dereference(pCtx)
}

db.proposalMap = nil
db.proposalTree.Children = nil

// Close the database
return db.fwDisk.Close()
}
Expand Down