Wait for the job queue to finish before shutting down
This commit is contained in:
parent
3eac06de6e
commit
2361cc0473
@ -172,15 +172,21 @@ LogEngine::LogEngine(const QString &driver, const QString &dbName, const QString
|
||||
}
|
||||
}
|
||||
|
||||
checkDBSize();
|
||||
|
||||
connect(&m_jobWatcher, SIGNAL(finished()), this, SLOT(handleJobFinished()));
|
||||
|
||||
checkDBSize();
|
||||
}
|
||||
|
||||
/*! Destructs the \l{LogEngine}. */
|
||||
LogEngine::~LogEngine()
|
||||
{
|
||||
// Process the job queue before allowing to shut down
|
||||
while (!m_jobQueue.isEmpty()) {
|
||||
qApp->processEvents();
|
||||
}
|
||||
if (!m_jobWatcher.isFinished()) {
|
||||
m_jobWatcher.waitForFinished();
|
||||
}
|
||||
m_db.close();
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user