Merge remote branch 'libcec-public/master'
[deb_libcec.git] / src / lib / platform / threads / threads.h
index 31c2daffa2e39c4ff5cf08ec768b0f235efbbe9a..1f62dcf0c1247511b24d6d7830416699a3a4c5d0 100644 (file)
@@ -41,14 +41,15 @@ namespace PLATFORM
     CThread(void) :
         m_bStop(false),
         m_bRunning(false),
-        m_bStopped(false) {}
+        m_bStopped(false),
+        m_thread(NULL) {}
 
     virtual ~CThread(void)
     {
       StopThread(0);
-      void *retVal;
-      ThreadsWait(m_thread, &retVal);
-      (void *)retVal; //"unreferenced local variable" warning
+      void *retVal = NULL;
+      if (m_thread)
+        ThreadsWait(m_thread, &retVal);
     }
 
     static void *ThreadHandler(CThread *thread)