Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

inputmgr: dont double free on hotplug #5855

Merged
merged 2 commits into from
May 3, 2024
Merged

Conversation

gulafaran
Copy link
Contributor

since we are also unrefing the state on hotplugging the keyboard set the state to nullptr so the destructor if case actually catches its been already freed.

Describe your PR, what does it fix/add?

#5852 got merged so fast it didnt feel right, im on a laptop so had to dig through the closet for an old logitech usb keyboard and lo and behold there was a missing nullptr here, without it double free occurs.

since we are also unrefing the state on hotplugging the keyboard set the
state to nullptr so the destructor if case actually catches its been
already freed.
d5bf153 added keymap unref at the end of updateXKBTranslationState to
not leak it when exiting, only it causes updateXKBTranslationState to
double free when changing layouts. since its already freed. remove the
unneeded extra xkb_keymap_unref.
Copy link
Member

@vaxerski vaxerski left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

@vaxerski vaxerski merged commit 1c73bea into hyprwm:main May 3, 2024
10 checks passed
@vaxerski
Copy link
Member

vaxerski commented May 3, 2024

got merged so fast it didnt feel right

hyprland

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants