input: Bug fix: Touches requries lock

This commit is contained in:
Hajime Hoshi 2016-05-29 22:13:42 +09:00
parent 683c692a5b
commit 05104744d3

View File

@ -105,6 +105,8 @@ func (i *input) IsGamepadButtonPressed(id int, button GamepadButton) bool {
} }
func (in *input) Touches() []Touch { func (in *input) Touches() []Touch {
i.m.RLock()
defer i.m.RUnlock()
t := make([]Touch, len(in.touches)) t := make([]Touch, len(in.touches))
for i := 0; i < len(t); i++ { for i := 0; i < len(t); i++ {
t[i] = &in.touches[i] t[i] = &in.touches[i]