From: Lars Op den Kamp Date: Thu, 22 Mar 2012 13:55:25 +0000 (+0100) Subject: cec: don't return from the Close() method in CUSBCECAdapterCommunication, because... X-Git-Tag: upstream/2.2.0~1^2~31^2~55 X-Git-Url: https://git.piment-noir.org/?a=commitdiff_plain;h=26516f2f0df6ed29be8c94f70247b9d0d6748042;p=deb_libcec.git cec: don't return from the Close() method in CUSBCECAdapterCommunication, because then it libCEC will try to delete it while it's still being used. --- diff --git a/src/lib/adapter/USBCECAdapterCommunication.cpp b/src/lib/adapter/USBCECAdapterCommunication.cpp index e092274..c97d995 100644 --- a/src/lib/adapter/USBCECAdapterCommunication.cpp +++ b/src/lib/adapter/USBCECAdapterCommunication.cpp @@ -77,11 +77,6 @@ CUSBCECAdapterCommunication::CUSBCECAdapterCommunication(CCECProcessor *processo m_port = new CSerialPort(strPort, iBaudRate); } -CUSBCECAdapterCommunication::~CUSBCECAdapterCommunication(void) -{ - Close(); -} - bool CUSBCECAdapterCommunication::CheckAdapter(uint32_t iTimeoutMs /* = 10000 */) { bool bReturn(false); @@ -225,7 +220,7 @@ bool CUSBCECAdapterCommunication::Open(IAdapterCommunicationCallback *cb, uint32 void CUSBCECAdapterCommunication::Close(void) { - StopThread(); + StopThread(0); } void *CUSBCECAdapterCommunication::Process(void) diff --git a/src/lib/adapter/USBCECAdapterCommunication.h b/src/lib/adapter/USBCECAdapterCommunication.h index bedd270..5db5a1a 100644 --- a/src/lib/adapter/USBCECAdapterCommunication.h +++ b/src/lib/adapter/USBCECAdapterCommunication.h @@ -67,7 +67,7 @@ namespace CEC { public: CUSBCECAdapterCommunication(CCECProcessor *processor, const char *strPort, uint16_t iBaudRate = 38400); - virtual ~CUSBCECAdapterCommunication(); + virtual ~CUSBCECAdapterCommunication() {}; virtual bool Open(IAdapterCommunicationCallback *cb, uint32_t iTimeoutMs = 10000, bool bSkipChecks = false); virtual void Close(void);