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 necessary cleanups such as uv_mutex_unlock are called always in GetSerialDevices(). #2343

Merged
merged 1 commit into from
Nov 26, 2021

Conversation

enami
Copy link
Contributor

@enami enami commented Nov 5, 2021

In the function GetSerialDevices() (in darwin_list.cpp), there are code paths that rest of iteration is skipped by continue statements. But by taking such paths, some necessary cleanups are also skipped (e.g., uv_mutex_unlock). And missing uv_mutex_unlock(), for example, results dead locks on next iteration.

This change makes sure that

  1. IOObjectRelease(device) is always called if device was not NULL,
  2. uv_mutex_unlock(&list_mutex) is always called if uv_mutex_lock(&list_mutex) was called, and
  3. IOObjectRelease(modemService) is always called if modemService was not NULL.

@GazHank GazHank added macOS Mac OS X / OS X needs-testing labels Nov 16, 2021
@reconbot
Copy link
Member

seems to work for me 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
macOS Mac OS X / OS X needs-testing
Development

Successfully merging this pull request may close these issues.

3 participants