From 750838581de54275d0635fe6729722f334309c67 Mon Sep 17 00:00:00 2001 From: Anon Date: Sat, 6 Aug 2016 15:47:24 -0500 Subject: [PATCH] Fix lock guard --- src/input_core/devices/Keyboard.cpp | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) 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, "");