mirror of
https://github.com/siemens-mobile-hacks/node-serialport-bindings-cpp.git
synced 2026-11-26 02:47:17 +00:00
Merge pull request #978 from enami/plug_handle_leak_on_windows
Plug windows handle leak when open failed.
This commit is contained in:
commit
db22b19a80
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