mirror of
https://github.com/wjwwood/serial.git
synced 2026-01-22 19:54:57 +08:00
resource leak if exception in SerialImpl constructor
This commit is contained in:
parent
d76b7d6b7f
commit
356c09523c
@ -39,10 +39,10 @@ Serial::SerialImpl::SerialImpl (const string &port, unsigned long baudrate,
|
||||
baudrate_ (baudrate), parity_ (parity),
|
||||
bytesize_ (bytesize), stopbits_ (stopbits), flowcontrol_ (flowcontrol)
|
||||
{
|
||||
read_mutex = CreateMutex(NULL, false, NULL);
|
||||
write_mutex = CreateMutex(NULL, false, NULL);
|
||||
if (port_.empty () == false)
|
||||
open ();
|
||||
read_mutex = CreateMutex(NULL, false, NULL);
|
||||
write_mutex = CreateMutex(NULL, false, NULL);
|
||||
}
|
||||
|
||||
Serial::SerialImpl::~SerialImpl ()
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user