posix: don't segfault when calling ThreadsWait() without a valid thread
[deb_libcec.git] / src / lib / platform / threads / threads.h
index c730da8256743c8132f7ef69279a365aa892854d..b5ccf3850815845b1d37e458ab163fcd78e62f93 100644 (file)
@@ -45,7 +45,10 @@ namespace PLATFORM
 
     virtual ~CThread(void)
     {
-      StopThread();
+      StopThread(0);
+      void *retVal;
+      ThreadsWait(m_thread, &retVal);
+      (void *)retVal; //"unreferenced local variable" warning
     }
 
     static void *ThreadHandler(CThread *thread)