internal/uidriver/mobile: Bug fix: Use mutex at RuneBuffers

This commit is contained in:
Hajime Hoshi 2021-07-10 01:39:32 +09:00
parent 26bb1b5f31
commit 5d2c8ad9be

View File

@ -161,6 +161,9 @@ func (i *Input) TouchPosition(id driver.TouchID) (x, y int) {
}
func (i *Input) RuneBuffer() []rune {
i.ui.m.RLock()
defer i.ui.m.RUnlock()
rs := make([]rune, len(i.runes))
copy(rs, i.runes)
return rs