fix buffer release time

pull/1269/head v3.37.1
Darien Raymond 6 years ago
parent 0067d3c80f
commit 334b7bf5ed
No known key found for this signature in database
GPG Key ID: 7251FFA14BB18169

@ -107,7 +107,6 @@ func (p *pipe) writeMultiBufferInternal(mb buf.MultiBuffer) error {
defer p.Unlock()
if err := p.getState(false); err != nil {
mb.Release()
return err
}
@ -122,7 +121,11 @@ func (p *pipe) WriteMultiBuffer(mb buf.MultiBuffer) error {
for {
err := p.writeMultiBufferInternal(mb)
if err == nil || err != errBufferFull {
if err == nil {
p.readSignal.Signal()
return nil
} else if err != errBufferFull {
mb.Release()
p.readSignal.Signal()
return err
}

Loading…
Cancel
Save