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