cec: reset m_socket to INVALID_SERIAL_SOCKET_VALUE after closing the connection
authorLars Op den Kamp <lars@opdenkamp.eu>
Thu, 22 Mar 2012 13:03:33 +0000 (14:03 +0100)
committerLars Op den Kamp <lars@opdenkamp.eu>
Thu, 22 Mar 2012 13:03:33 +0000 (14:03 +0100)
src/lib/platform/windows/serialport.cpp

index f2d28c5b7340256f652a59931451cf2f2c9c8c0c..c0cdd936af9e586991ac2e6b463ca2df1674abc8 100644 (file)
@@ -86,12 +86,14 @@ void CSerialSocket::Close(void)
 {
   if (IsOpen())
     SerialSocketClose(m_socket);
+  m_socket = INVALID_SERIAL_SOCKET_VALUE;
 }
 
 void CSerialSocket::Shutdown(void)
 {
   if (IsOpen())
     SerialSocketClose(m_socket);
+  m_socket = INVALID_SERIAL_SOCKET_VALUE;
 }
 
 ssize_t CSerialSocket::Write(void* data, size_t len)