Moar threading stuff
[irwi] / src / selectremotedlg.cpp
index 8b1085e..dbc8115 100644 (file)
@@ -131,7 +131,10 @@ void SelectRemoteDlg::refreshDB()
 {
     setBusy(true);
     if (onlinePollerThread != NULL) {
+        onlinePollerThread->stop();
+        onlinePollerThread->wait();
         delete onlinePollerThread;
+        onlinePollerThread = NULL;
     }
     onlinePollerThread = new OnlinePollerThread();
     connect(onlinePollerThread, SIGNAL(online()),