diff --git a/src/input_core/devices/Keyboard.cpp b/src/input_core/devices/Keyboard.cpp index c3e1c95e3..a4fd8475f 100644 --- a/src/input_core/devices/Keyboard.cpp +++ b/src/input_core/devices/Keyboard.cpp @@ -18,9 +18,11 @@ bool Keyboard::InitDevice(int number, const std::map lock(m); - auto keysPressedCopy = keysPressed; - lock.~lock_guard(); + std::map keysPressedCopy; + { + std::lock_guard lock(m); + keysPressedCopy = keysPressed; + } for (const auto &ent1 : keyMapping) { int scancode = std::stoul(ent1.first, nullptr, 16); KeyboardKey proxy = KeyboardKey(0, scancode, "");