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

Make sure the config file mutex is initialized before being used #3756

Closed
wants to merge 1 commit into from

Conversation

tarek-y-ismail
Copy link
Contributor

Since the order of initialization is the same as the order of declaration, the config file was initialized before the mutex. But it would use the mutex during its construction since it loads on construction, causing an error to be thrown and the application to crash.

@tarek-y-ismail tarek-y-ismail requested a review from a team as a code owner February 12, 2025 10:35
@tarek-y-ismail tarek-y-ismail self-assigned this Feb 12, 2025
Copy link
Collaborator

@AlanGriffiths AlanGriffiths left a comment

Choose a reason for hiding this comment

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

Non-blocking comment: It might be clearer to place the mutex above the mouse, touchpad and keyboard variables as their use is actually what it guards. (Not that the code is particularly clear about this either way - ideas welcome)

Since the order of initialization is the same as the order of
declaration, the config file was initialized before the mutex. But it
would use the mutex during its construction since it loads on
construction, causing an error to be thrown and the application to
crash.
@tarek-y-ismail tarek-y-ismail force-pushed the init-mutex-before-using-config branch from 2472e9a to acd62ff Compare February 12, 2025 12:26
@tarek-y-ismail
Copy link
Contributor Author

tarek-y-ismail commented Feb 12, 2025

Seems like I snuck in this change in another small PR and forgot. This PR is not needed anymore.

@tarek-y-ismail tarek-y-ismail deleted the init-mutex-before-using-config branch February 12, 2025 12:28
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