m_lastPollDestination = msg.Destination();
if (msg.Destination() < CECDEVICE_BROADCAST)
{
+ CLockObject waitingLock(m_waitingMutex);
if (!m_bWaitingForAck[msg.Destination()] && !msg.IsEOM())
{
if (m_callback)
/* mark as waiting for an ack from the destination */
if (dest < CECDEVICE_BROADCAST)
{
- CLockObject lock(m_mutex);
+ CLockObject waitingLock(m_waitingMutex);
m_bWaitingForAck[dest] = true;
}
}
/* 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())
{
}
}
- 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.");