Skip to content

Conversation

@derickr
Copy link
Contributor

@derickr derickr commented Sep 15, 2023

When running AddButton in a go-routine, I received the following errors:

fatal error: concurrent map writes

goroutine 13 [running]:
github.com/magicmonkey/go-streamdeck.(*StreamDeck).AddButton(0xc000122a68, 0xe?, {0x8b68e0, 0xc0000aa050})
	/home/derick/dev/go/src/github.com/magicmonkey/go-streamdeck/streamdeck.go:59 +0xa7
github.com/derickr/streamdeck-goui/addons.(*Clock).Init.func1(0x6)
	/home/derick/dev/go/src/github.com/derickr/streamdeck-goui/addons/clock.go:70 +0x7b7
created by github.com/derickr/streamdeck-goui/addons.(*Clock).Init
	/home/derick/dev/go/src/github.com/derickr/streamdeck-goui/addons/clock.go:48 +0x30

It turned out that the method did not use a mutex for this.

Similarly, I frequently got corrupt images, and the addition of the mutex to the function that writes these images to the Stream Deck fixes that.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant