-
Notifications
You must be signed in to change notification settings - Fork 278
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
MidiInWinMM :: closePort might return without calling LeaveCriticalSection #325
Comments
Here is the complete fix. With this, the critical section will be unlocked for all code paths that can exit the method:
|
I think I may have been observing the subsequent deadlock that will occur by not leaving the cs here. |
Is there a matching PR for this? |
During a code review I noticed that the method MidiInWinMM :: closePort looks like it might possibly fail to release an acquired critical section:
At the end of the for loop, return might be called, and this would exit the function without calling LeaveCriticalSection on the last line.
Is this intentional, or a bug? If it is a bug, using a Locker class that will call LeaveCriticalSection in its destructor would fix the issue.
The text was updated successfully, but these errors were encountered: