Index: programs/mythfrontend/networkcontrol.cpp
===================================================================
--- programs/mythfrontend/networkcontrol.cpp	(revision 13665)
+++ programs/mythfrontend/networkcontrol.cpp	(working copy)
@@ -179,6 +179,7 @@
     keyMap["f23"]                    = Qt::Key_F23;
     keyMap["f24"]                    = Qt::Key_F24;
 
+    stopCommandThread = false;
     pthread_create(&command_thread, NULL, CommandThread, this);
 
     gContext->addListener(this);
@@ -193,7 +194,10 @@
 
     notifyDataAvailable();
 
-    pthread_cancel(command_thread);
+    stopCommandThread = true;
+    ncLock.lock();
+    ncCond.wakeOne();
+    ncLock.unlock();
     pthread_join(command_thread, NULL);
 }
 
@@ -209,14 +213,16 @@
 {
     QString command;
 
-    for (;;)
+    while (!stopCommandThread)
     {
-        pthread_testcancel();
-
         ncLock.lock();
         while (!networkControlCommands.size()) {
             ncCond.wait(&ncLock);
-            pthread_testcancel();
+            if (stopCommandThread)
+            {
+                ncLock.unlock();
+                return;
+            }
         }
         command = networkControlCommands.front(); 
         networkControlCommands.pop_front();
Index: programs/mythfrontend/networkcontrol.h
===================================================================
--- programs/mythfrontend/networkcontrol.h	(revision 13665)
+++ programs/mythfrontend/networkcontrol.h	(working copy)
@@ -69,6 +69,7 @@
     QMutex nrLock;
 
     pthread_t command_thread;
+    bool stopCommandThread;
 };
 
 #endif
