mirror of
https://github.com/taigrr/bubbletea.git
synced 2026-04-02 02:59:09 -07:00
Remove redundant lock in listen
This commit is contained in:
committed by
Christian Muehlhaeuser
parent
1ee40507ef
commit
2d602a1244
@@ -65,7 +65,7 @@ func (r *standardRenderer) start() {
|
|||||||
func (r *standardRenderer) stop() {
|
func (r *standardRenderer) stop() {
|
||||||
r.flush()
|
r.flush()
|
||||||
clearLine(r.out)
|
clearLine(r.out)
|
||||||
r.done <- struct{}{}
|
close(r.done)
|
||||||
}
|
}
|
||||||
|
|
||||||
// listen waits for ticks on the ticker, or a signal to stop the renderer.
|
// listen waits for ticks on the ticker, or a signal to stop the renderer.
|
||||||
@@ -77,11 +77,8 @@ func (r *standardRenderer) listen() {
|
|||||||
r.flush()
|
r.flush()
|
||||||
}
|
}
|
||||||
case <-r.done:
|
case <-r.done:
|
||||||
r.mtx.Lock()
|
|
||||||
r.ticker.Stop()
|
r.ticker.Stop()
|
||||||
r.ticker = nil
|
r.ticker = nil
|
||||||
r.mtx.Unlock()
|
|
||||||
close(r.done)
|
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user