Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCampbell Barton <campbell@blender.org>2022-06-16 07:55:37 +0300
committerCampbell Barton <campbell@blender.org>2022-06-16 07:55:37 +0300
commita17f74ab341b026387fef6b741e3c0901780526c (patch)
tree82473f4ad6dcc25fe226ad7c9172e037ee2663ba
parent0d644e6d06de349b04c5c54f19eff9c6fe00b32a (diff)
Fix memory leak plugging in new keyboards in wayland
-rw-r--r--intern/ghost/intern/GHOST_SystemWayland.cpp9
1 files changed, 7 insertions, 2 deletions
diff --git a/intern/ghost/intern/GHOST_SystemWayland.cpp b/intern/ghost/intern/GHOST_SystemWayland.cpp
index cf5ba550e55..93d85f33dda 100644
--- a/intern/ghost/intern/GHOST_SystemWayland.cpp
+++ b/intern/ghost/intern/GHOST_SystemWayland.cpp
@@ -1607,8 +1607,13 @@ static void keyboard_handle_keymap(
return;
}
- input->xkb_state = xkb_state_new(keymap);
-
+ struct xkb_state *xkb_state_next = xkb_state_new(keymap);
+ if (xkb_state_next) {
+ if (input->xkb_state) {
+ xkb_state_unref(input->xkb_state);
+ }
+ input->xkb_state = xkb_state_next;
+ }
xkb_keymap_unref(keymap);
}