mirror of
https://github.com/siemens-mobile-hacks/node-serialport-bindings-cpp.git
synced 2026-11-25 18:37:19 +00:00
fix: OSX List Make sure necessary cleanups such as uv_mutex_unlock are called always. (#2343)
This commit is contained in:
parent
99970852c7
commit
fc93cb6af8
1 changed files with 15 additions and 19 deletions
|
|
@ -237,27 +237,23 @@ static stDeviceListItem* GetSerialDevices() {
|
|||
kernResult = IOCreatePlugInInterfaceForService(device, kIOUSBDeviceUserClientTypeID, kIOCFPlugInInterfaceID,
|
||||
&plugInInterface, &score);
|
||||
|
||||
if ((kIOReturnSuccess != kernResult) || !plugInInterface) {
|
||||
continue;
|
||||
if ((kIOReturnSuccess == kernResult) && plugInInterface) {
|
||||
// Use the plugin interface to retrieve the device interface.
|
||||
res = (*plugInInterface)->QueryInterface(plugInInterface, CFUUIDGetUUIDBytes(kIOUSBDeviceInterfaceID),
|
||||
reinterpret_cast<LPVOID*> (&deviceInterface));
|
||||
|
||||
// Now done with the plugin interface.
|
||||
(*plugInInterface)->Release(plugInInterface);
|
||||
|
||||
if (!res && deviceInterface != NULL) {
|
||||
// Extract the desired Information
|
||||
ExtractUsbInformation(serialDevice, deviceInterface);
|
||||
|
||||
// Release the Interface
|
||||
(*deviceInterface)->Release(deviceInterface);
|
||||
}
|
||||
}
|
||||
|
||||
// Use the plugin interface to retrieve the device interface.
|
||||
res = (*plugInInterface)->QueryInterface(plugInInterface, CFUUIDGetUUIDBytes(kIOUSBDeviceInterfaceID),
|
||||
reinterpret_cast<LPVOID*> (&deviceInterface));
|
||||
|
||||
// Now done with the plugin interface.
|
||||
(*plugInInterface)->Release(plugInInterface);
|
||||
|
||||
if (res || deviceInterface == NULL) {
|
||||
continue;
|
||||
}
|
||||
|
||||
// Extract the desired Information
|
||||
ExtractUsbInformation(serialDevice, deviceInterface);
|
||||
|
||||
// Release the Interface
|
||||
(*deviceInterface)->Release(deviceInterface);
|
||||
|
||||
// Release the device
|
||||
(void) IOObjectRelease(device);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue