From: Lars Op den Kamp Date: Thu, 22 Mar 2012 19:07:24 +0000 (+0100) Subject: cec: call Close() when the connection could not be (fully) opened in CUSBCECAdapterCo... X-Git-Tag: upstream/2.2.0~1^2~31^2~54 X-Git-Url: https://git.piment-noir.org/?a=commitdiff_plain;h=8feaee8d445bd5837a5e042ddb7fadbfd0e965c5;p=deb_libcec.git cec: call Close() when the connection could not be (fully) opened in CUSBCECAdapterCommunication::Open() --- diff --git a/src/lib/adapter/USBCECAdapterCommunication.cpp b/src/lib/adapter/USBCECAdapterCommunication.cpp index c97d995..99086ce 100644 --- a/src/lib/adapter/USBCECAdapterCommunication.cpp +++ b/src/lib/adapter/USBCECAdapterCommunication.cpp @@ -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"); } }