input: add missing lock to keyboard handler ReleaseAllKeys

This should fix a segfault I encountered when closing a game.
I think the consumers were removed while the window went out of focus.
This commit is contained in:
Megamouse 2024-06-26 21:19:18 +02:00
parent 8050e1f853
commit 11ee80a070

View file

@ -306,6 +306,8 @@ void keyboard_consumer::SetIntercepted(bool intercepted)
void KeyboardHandlerBase::ReleaseAllKeys()
{
std::lock_guard<std::mutex> lock(m_mutex);
for (auto& [id, consumer] : m_consumers)
{
consumer.ReleaseAllKeys();