Sleep
This commit is contained in:
@@ -23,6 +23,7 @@
|
||||
|
||||
#include "httpserver.h"
|
||||
#include "httpsocket.h"
|
||||
#include "utils.h"
|
||||
#include <QtCore/QUrl>
|
||||
#include <QtCore/QThread>
|
||||
#ifdef ENABLE_KDE_SUPPORT
|
||||
@@ -30,11 +31,6 @@
|
||||
K_GLOBAL_STATIC(HttpServer, instance)
|
||||
#endif
|
||||
|
||||
struct Thread : public QThread
|
||||
{
|
||||
static void sleep() { QThread::msleep(100); }
|
||||
};
|
||||
|
||||
HttpServer * HttpServer::self()
|
||||
{
|
||||
#ifdef ENABLE_KDE_SUPPORT
|
||||
@@ -56,10 +52,9 @@ void HttpServer::stop()
|
||||
}
|
||||
|
||||
if (thread) {
|
||||
thread->quit();
|
||||
for(int i=0; i<10 && thread->isRunning(); ++i) {
|
||||
Thread::sleep();
|
||||
}
|
||||
Utils::stopThread(thread);
|
||||
thread->deleteLater();
|
||||
thread=0;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user