cec: keep the mutex locked when calling ReplaceHandlers() in CCECProcessor
authorLars Op den Kamp <lars@opdenkamp.eu>
Mon, 6 Feb 2012 10:15:22 +0000 (11:15 +0100)
committerLars Op den Kamp <lars@opdenkamp.eu>
Mon, 6 Feb 2012 10:15:22 +0000 (11:15 +0100)
src/lib/CECProcessor.cpp

index c63bc57666f846a381571eb84d11042fb06ae818..e45eda0ac8428ee5ccb78245caaf22e76cc985e4 100644 (file)
@@ -383,6 +383,7 @@ bool CCECProcessor::FindLogicalAddresses(void)
 
 void CCECProcessor::ReplaceHandlers(void)
 {
+  CLockObject lock(m_mutex);
   if (!IsInitialised())
     return;
   for (uint8_t iPtr = 0; iPtr <= CECDEVICE_PLAYBACKDEVICE3; iPtr++)
@@ -636,6 +637,7 @@ bool CCECProcessor::SetPhysicalAddress(uint16_t iPhysicalAddress, bool bSendUpda
   bool bSendActiveView(false);
   bool bReturn(false);
   cec_logical_addresses sendUpdatesTo;
+  sendUpdatesTo.Clear();
 
   {
     CLockObject lock(m_mutex);