replaced 2 more occurences of Close() by m_port->Close()
authorLars Op den Kamp <lars@opdenkamp.eu>
Mon, 14 May 2012 20:06:33 +0000 (22:06 +0200)
committerLars Op den Kamp <lars@opdenkamp.eu>
Mon, 14 May 2012 20:06:33 +0000 (22:06 +0200)
src/lib/adapter/USBCECAdapterCommunication.cpp

index 70eddb84c0cb4755cada60539bf67460194f05fd..801ebc509550fda47fe1b80dff0dce9cca77befc 100644 (file)
@@ -341,7 +341,8 @@ bool CUSBCECAdapterCommunication::WriteToDevice(CCECAdapterMessage *message)
   {
     LIB_CEC->AddLog(CEC_LOG_DEBUG, "error writing command '%s' to serial port '%s': %s", CCECAdapterMessage::ToString(message->Message()), m_port->GetName().c_str(), m_port->GetError().c_str());
     message->state = ADAPTER_MESSAGE_STATE_ERROR;
-    Close();
+    // this will trigger an alert in the reader thread
+    m_port->Close();
     return false;
   }
 
@@ -486,7 +487,7 @@ bool CUSBCECAdapterCommunication::StartBootloader(void)
 {
   if (m_port->IsOpen() && m_commands->StartBootloader())
   {
-    Close();
+    m_port->Close();
     return true;
   }
   return false;