diff --git a/fulltextsearch.cc b/fulltextsearch.cc index dbfba262..9b701b44 100644 --- a/fulltextsearch.cc +++ b/fulltextsearch.cc @@ -36,6 +36,7 @@ void Indexing::run() { try { + timerThread->start(); // First iteration - dictionaries with no more MaxDictionarySizeForFastSearch articles for( size_t x = 0; x < dictionaries.size(); x++ ) { @@ -63,6 +64,9 @@ void Indexing::run() dictionaries.at( x )->makeFTSIndex( isCancelled, false ); } } + + timerThread->quit(); + timerThread->wait(); } catch( std::exception &ex ) { diff --git a/fulltextsearch.hh b/fulltextsearch.hh index c3bed543..341a3db6 100644 --- a/fulltextsearch.hh +++ b/fulltextsearch.hh @@ -89,28 +89,15 @@ public: timerThread(new QThread(this)) { connect(timer, &QTimer::timeout, this, &Indexing::timeout); -// timer->start(2000); timer->moveToThread(timerThread); connect(timerThread, &QThread::started, timer, [this](){timer->start(2000);}); connect(timerThread, &QThread::finished, timer, &QTimer::stop); - timerThread->start(); } ~Indexing() { - if(timerThread){ - qInfo()<<"delete thread"; - timerThread->quit(); - timerThread->wait(); - delete timerThread; - timerThread = nullptr; - } - if(timer){ - qInfo()<<"delete timer"; - delete timer; - timer = nullptr; - } + emit sendNowIndexingName( QString() ); hasExited.release();