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

libobs: Fix deadlock on macOS input method change #11663

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

izwb003
Copy link

@izwb003 izwb003 commented Dec 23, 2024

Description

Fixed a deadlock in macOS input method change handler.

Motivation and Context

In the existing code for handling macOS input method changes, if keyboard layout information is correctly obtained, it will result in the mutex of hotkeys never being released.

This will cause a deadlock on hotkeys and freeze OBS when exit. See #11650.

How Has This Been Tested?

Tested on macOS Sequoia 15.2, seems fixed the issue.

Types of changes

  • Bug fix (non-breaking change which fixes an issue)

Checklist:

  • My code has been run through clang-format.
  • I have read the contributing document.
  • My code is not on the master branch.
  • The code has been tested.
  • All commit messages are properly formatted and commits squashed where appropriate.
  • I have included updates to all appropriate documentation.

@gxalpha gxalpha added Bug Fix Non-breaking change which fixes an issue macOS Affects macOS labels Dec 23, 2024
@jcm93
Copy link
Contributor

jcm93 commented Dec 23, 2024

Looks good to me.

Looks like this essentially just restores the logic of the old code which unlocked this mutex if we did not return early. The refactor seems to have just missed that.

@izwb003
Copy link
Author

izwb003 commented Dec 23, 2024

Looks good to me.

Looks like this essentially just restores the logic of the old code which unlocked this mutex if we did not return early. The refactor seems to have just missed that.

I cannot dig more into it; Perhaps people who are more familiar with the relevant code can make better refactoring.

@jcm93
Copy link
Contributor

jcm93 commented Dec 23, 2024

Sorry, when I was referring to "refactor" I was talking about the work done in 4dac849. Your work seems fine to me and fixes logic that was erroneously changed by that refactor.

@izwb003
Copy link
Author

izwb003 commented Dec 23, 2024

Sorry, when I was referring to "refactor" I was talking about the work done in 4dac849. Your work seems fine to me and fixes logic that was erroneously changed by that refactor.

Oops I see it... Thank you for your professional view. I will wait for the team's review.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Fix Non-breaking change which fixes an issue macOS Affects macOS
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants