fix incorrect deferred vm release

This commit is contained in:
vyzo 2023-03-23 19:51:23 +02:00 committed by Maciej Witowski
parent 4b6e7cc30d
commit 97c5df540d
2 changed files with 2 additions and 2 deletions

View File

@ -108,7 +108,7 @@ func SetupStorageMiners(ctx context.Context, cs *store.ChainStore, sys vm.Syscal
if err != nil { if err != nil {
return cid.Undef, fmt.Errorf("creating vm: %w", err) return cid.Undef, fmt.Errorf("creating vm: %w", err)
} }
defer genesisVm.Done() defer func() { genesisVm.Done() }()
if len(miners) == 0 { if len(miners) == 0 {
return cid.Undef, xerrors.New("no genesis miners") return cid.Undef, xerrors.New("no genesis miners")

View File

@ -169,7 +169,7 @@ func (sm *StateManager) callInternal(ctx context.Context, msg *types.Message, pr
if err != nil { if err != nil {
return nil, xerrors.Errorf("failed to set up vm: %w", err) return nil, xerrors.Errorf("failed to set up vm: %w", err)
} }
defer vmi.Done() defer func() { vmi.Done() }()
for i, m := range priorMsgs { for i, m := range priorMsgs {
_, err = vmi.ApplyMessage(ctx, m) _, err = vmi.ApplyMessage(ctx, m)