Moar threading stuff
authorTorste Aikio <zokier@zokier.laptop>
Tue, 6 Jul 2010 12:27:05 +0000 (15:27 +0300)
committerTorste Aikio <zokier@zokier.laptop>
Tue, 6 Jul 2010 12:27:05 +0000 (15:27 +0300)
src/onlinepollerthread.cpp
src/selectremotedlg.cpp

index 89cc31a..6e1cdac 100644 (file)
@@ -18,11 +18,11 @@ void OnlinePollerThread::run()
             if (!qncm.isOnline()) {
                 msleep(250);
             } else {
+                emit online();
                 break;
             }
         }
     }
-    emit online();
     exec();
 }
 
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()),