cec-client: fixed entering bootloader mode
[deb_libcec.git] / src / lib / adapter / USBCECAdapterCommunication.cpp
index 1d3df13c907541d4863a902644f395bec06cfae1..3b8d2a39275c4f847f7da6cfe7f03dfc6ca18be1 100644 (file)
@@ -458,7 +458,12 @@ bool CUSBCECAdapterCommunication::IsInitialised(void)
 
 bool CUSBCECAdapterCommunication::StartBootloader(void)
 {
-  return m_port->IsOpen() ? m_commands->StartBootloader() : false;
+  if (m_port->IsOpen() && m_commands->StartBootloader())
+  {
+    Close();
+    return true;
+  }
+  return false;
 }
 
 bool CUSBCECAdapterCommunication::SetAckMask(uint16_t iMask)