core/state/snapshot: acquire the lock on release

This commit is contained in:
Marius van der Wijden 2024-06-17 09:49:24 +02:00
parent fd5078c779
commit 4c8dc88a48

View file

@ -666,6 +666,9 @@ func diffToDisk(bottom *diffLayer) *diskLayer {
// Release releases resources
func (t *Tree) Release() {
t.lock.Lock()
defer t.lock.Unlock()
if dl := t.disklayer(); dl != nil {
dl.Release()
}