added QLocalServer::removeServer to YACReaderLocalServer for fixing server start up after a dirty exit

This commit is contained in:
Luis Ángel San Martín
2013-11-23 15:04:48 -08:00
parent 3277a12665
commit 23d5abd329
2 changed files with 8 additions and 3 deletions

View File

@ -9,6 +9,8 @@
#include "comic_db.h"
#include "QsLog.h"
using namespace YACReader;
QMutex YACReaderClientConnectionWorker::dbMutex;
@ -17,8 +19,9 @@ YACReaderLocalServer::YACReaderLocalServer(QObject *parent) :
QObject(parent)
{
localServer = new QLocalServer(this);
QLocalServer::removeServer(YACREADERLIBRARY_GUID);
if (!localServer->listen(YACREADERLIBRARY_GUID)) {
//error...........
QLOG_ERROR() << "Unable to create local server";
}
connect(localServer, SIGNAL(newConnection()), this, SLOT(sendResponse()));