Cleanup sing buffer usage

This commit is contained in:
H1JK 2023-12-15 23:45:41 +08:00 committed by yuhan6665
parent 38b175d53e
commit c01a30e8f4
6 changed files with 11 additions and 14 deletions

View file

@ -88,13 +88,13 @@ func (i *Inbound) Process(ctx context.Context, network net.Network, connection s
}
for _, buffer := range mb {
packet := B.As(buffer.Bytes()).ToOwned()
buffer.Release()
err = i.service.NewPacket(ctx, pc, packet, metadata)
if err != nil {
packet.Release()
buf.ReleaseMulti(mb)
return err
}
buffer.Release()
}
}
}