cosmetics: AddLog() has formatting params
[deb_libcec.git] / src / lib / adapter / USBCECAdapterCommunication.cpp
index e2b03862d437cf75da03dda403a94e3da4e8f600..b439f748aeb5e3a9ceeaaa742768152a92a126dd 100644 (file)
@@ -55,12 +55,6 @@ CUSBCECAdapterCommunication::CUSBCECAdapterCommunication(CCECProcessor *processo
 CUSBCECAdapterCommunication::~CUSBCECAdapterCommunication(void)
 {
   Close();
-
-  if (m_port)
-  {
-    delete m_port;
-    m_port = NULL;
-  }
 }
 
 bool CUSBCECAdapterCommunication::Open(uint32_t iTimeoutMs /* = 10000 */)
@@ -143,6 +137,12 @@ void *CUSBCECAdapterCommunication::Process(void)
   if (m_outBuffer.Pop(msg))
     msg->condition.Broadcast();
 
+  if (m_port)
+  {
+    delete m_port;
+    m_port = NULL;
+  }
+
   return NULL;
 }
 
@@ -412,9 +412,7 @@ bool CUSBCECAdapterCommunication::SetLineTimeout(uint8_t iTimeout)
 bool CUSBCECAdapterCommunication::SetAckMask(uint16_t iMask)
 {
   bool bReturn(false);
-  CStdString strLog;
-  strLog.Format("setting ackmask to %2x", iMask);
-  CLibCEC::AddLog(CEC_LOG_DEBUG, strLog.c_str());
+  CLibCEC::AddLog(CEC_LOG_DEBUG, "setting ackmask to %2x", iMask);
 
   CCECAdapterMessage *output = new CCECAdapterMessage;
 
@@ -436,9 +434,7 @@ bool CUSBCECAdapterCommunication::SetAckMask(uint16_t iMask)
 bool CUSBCECAdapterCommunication::SetControlledMode(bool controlled)
 {
   bool bReturn(false);
-  CStdString strLog;
-  strLog.Format("turning controlled mode %s", controlled ? "on" : "off");
-  CLibCEC::AddLog(CEC_LOG_DEBUG, strLog.c_str());
+  CLibCEC::AddLog(CEC_LOG_DEBUG, "turning controlled mode %s", controlled ? "on" : "off");
 
   CCECAdapterMessage *output = new CCECAdapterMessage;