Release 2.2.0
[deb_libcec.git] / src / lib / adapter / Pulse-Eight / USBCECAdapterCommunication.cpp
index 037359599be766fce14a87779e3405318393927f..1be07c51fbb385e224a7fa5ec1ff0c2cb40515f9 100644 (file)
@@ -710,7 +710,7 @@ void *CAdapterPingThread::Process(void)
       /* send a ping to the adapter */
       bool bPinged(false);
       int iFailedCounter(0);
-      while (!bPinged && iFailedCounter < 3)
+      while (!bPinged && iFailedCounter < 3 && !IsStopped())
       {
         if (!m_com->PingAdapter())
         {
@@ -724,7 +724,7 @@ void *CAdapterPingThread::Process(void)
         }
       }
 
-      if (iFailedCounter == 3)
+      if (iFailedCounter == 3 && !IsStopped())
       {
         /* failed to ping the adapter 3 times in a row. something must be wrong with the connection */
         m_com->LIB_CEC->AddLog(CEC_LOG_ERROR, "failed to ping the adapter 3 times in a row. closing the connection.");