mirror of
https://github.com/siemens-mobile-hacks/node-serialport-bindings-cpp.git
synced 2026-11-25 18:37:19 +00:00
Plug windows handle leak when open failed.
This commit is contained in:
parent
23de171055
commit
f25563dded
1 changed files with 3 additions and 0 deletions
|
|
@ -88,6 +88,7 @@ void EIO_Open(uv_work_t* req) {
|
|||
|
||||
if (!GetCommState(file, &dcb)) {
|
||||
ErrorCodeToString("Open (GetCommState)", GetLastError(), data->errorString);
|
||||
CloseHandle(file);
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
@ -142,6 +143,7 @@ void EIO_Open(uv_work_t* req) {
|
|||
|
||||
if (!SetCommState(file, &dcb)) {
|
||||
ErrorCodeToString("Open (SetCommState)", GetLastError(), data->errorString);
|
||||
CloseHandle(file);
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
@ -155,6 +157,7 @@ void EIO_Open(uv_work_t* req) {
|
|||
|
||||
if (!SetCommTimeouts(file, &commTimeouts)) {
|
||||
ErrorCodeToString("Open (SetCommTimeouts)", GetLastError(), data->errorString);
|
||||
CloseHandle(file);
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue