summaryrefslogtreecommitdiff
path: root/src/managers/input/InputManager.cpp
diff options
context:
space:
mode:
authorMichael <michaelpacheco@protonmail.com>2023-08-07 10:34:15 -0700
committerGitHub <noreply@github.com>2023-08-07 19:34:15 +0200
commitcebab759d52747c2067217d93096b47281722e57 (patch)
treed75ec6f1a74cee6f8c5c0656d87f60f9462df8c9 /src/managers/input/InputManager.cpp
parentdeeeb33c5f919ad5499a10526772b617f24d72ab (diff)
Close keymap files. Fixes #2904 (#2905)
Signed-off-by: Michael Pacheco <git@michaelpacheco.org>
Diffstat (limited to 'src/managers/input/InputManager.cpp')
-rw-r--r--src/managers/input/InputManager.cpp7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/managers/input/InputManager.cpp b/src/managers/input/InputManager.cpp
index 1df5acb3..f4382838 100644
--- a/src/managers/input/InputManager.cpp
+++ b/src/managers/input/InputManager.cpp
@@ -786,8 +786,11 @@ void CInputManager::applyConfigToKeyboard(SKeyboard* pKeyboard) {
if (!std::filesystem::exists(path))
Debug::log(ERR, "input:kb_file= file doesnt exist");
- else
- KEYMAP = xkb_keymap_new_from_file(CONTEXT, fopen(path.c_str(), "r"), XKB_KEYMAP_FORMAT_TEXT_V1, XKB_KEYMAP_COMPILE_NO_FLAGS);
+ else {
+ FILE* const KEYMAPFILE = fopen(FILEPATH.c_str(), "r");
+ KEYMAP = xkb_keymap_new_from_file(CONTEXT, KEYMAPFILE, XKB_KEYMAP_FORMAT_TEXT_V1, XKB_KEYMAP_COMPILE_NO_FLAGS);
+ fclose(KEYMAPFILE);
+ }
}
if (!KEYMAP)