cec: call Close() when the connection could not be (fully) opened in CUSBCECAdapterCo...
authorLars Op den Kamp <lars@opdenkamp.eu>
Thu, 22 Mar 2012 19:07:24 +0000 (20:07 +0100)
committerLars Op den Kamp <lars@opdenkamp.eu>
Thu, 22 Mar 2012 19:07:24 +0000 (20:07 +0100)
src/lib/adapter/USBCECAdapterCommunication.cpp

index c97d9955f8d7855f5aa3b7249f6adf032548be3e..99086ce94f54dbbc4e88cc692437e2e210fca0dd 100644 (file)
@@ -200,6 +200,7 @@ bool CUSBCECAdapterCommunication::Open(IAdapterCommunicationCallback *cb, uint32
   if (!bSkipChecks && !CheckAdapter())
   {
     CLibCEC::AddLog(CEC_LOG_ERROR, "the adapter failed to pass basic checks");
+    Close();
     return false;
   }
   else
@@ -211,6 +212,7 @@ bool CUSBCECAdapterCommunication::Open(IAdapterCommunicationCallback *cb, uint32
     }
     else
     {
+      Close();
       CLibCEC::AddLog(CEC_LOG_ERROR, "could not create a communication thread");
     }
   }