cec: fix segfault on exit
[deb_libcec.git] / src / lib / CECProcessor.cpp
index 127155a95195da75004f01213761ffd8dce62195..4a276ee760b7cc1b1b406e127a3a8e6fc37d401c 100644 (file)
@@ -89,14 +89,16 @@ void *CCECProcessor::Process(void)
         bParseFrame = ParseMessage(msg);
     }
 
-    if (bParseFrame)
+    if (!m_bStop && bParseFrame)
       ParseCurrentFrame();
 
-    m_controller->CheckKeypressTimeout();
-    CCondition::Sleep(50);
+    if (!m_bStop)
+    {
+      m_controller->CheckKeypressTimeout();
+      CCondition::Sleep(50);
+    }
   }
 
-  m_controller->AddLog(CEC_LOG_DEBUG, "processor thread terminated");
   return NULL;
 }