T66 A new smart pointer for managing a CContinuousWorker subclass instance.

Owns the worker before it starts, when ownership is transferred to the thread.
This commit is contained in:
Mathew Sutcliffe
2017-05-06 23:46:53 +01:00
parent ca81c65eae
commit 41ff563e19
4 changed files with 70 additions and 8 deletions

View File

@@ -8,7 +8,6 @@
*/
#include "swiftdata.h"
#include "blackcore/db/backgrounddataupdater.h"
#include "blackcore/data/globalsetup.h"
#include "blackgui/components/datamaininfoareacomponent.h"
#include "blackgui/components/dbmappingcomponent.h"
@@ -163,14 +162,14 @@ void CSwiftData::consolidationSettingChanged()
{
ui->comp_MainInfoArea->getDataSettingsComponent()->setBackgroundUpdater(nullptr);
m_updater->gracefulShutdown();
m_updater.reset(nullptr);
m_updater = nullptr;
}
}
else
{
if (!m_updater)
{
m_updater.reset(new CBackgroundDataUpdater(this));
m_updater = m_updater.create(this);
m_updater->start(QThread::LowestPriority);
ui->comp_MainInfoArea->getDataSettingsComponent()->setBackgroundUpdater(m_updater.data());
}