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

Use recursive mutex for GUI window handling #736

Closed
wants to merge 1 commit into from

Conversation

catmeow72
Copy link
Contributor

This avoids a crash when opening a window in onClose.

This avoids a crash when opening a window in onClose.
@catmeow72
Copy link
Contributor Author

Note that this does not yet seem to allow to actually open a window in onClose, but at least the attempt doesn't crash.

@IntegratedQuantum
Copy link
Member

I don't like recursive mutexes, and this PR is a good example why they can lead to bugs.
With your changes you are appending to the list while iterating on it, which could result in a use after free in the worst case.
And of course the list is cleared after the iteration is done, which is why the newly added element is discarded without further consideration.

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