From 5d7289adb32f1f42c32f8ccc33d3cd6b0c202d1d Mon Sep 17 00:00:00 2001 From: Mathew Sutcliffe Date: Wed, 19 Oct 2016 00:14:51 +0100 Subject: [PATCH] refs #784 The data cache worker thread could interfere with performance measurements, so only run it in applications that start the main event loop. --- src/blackmisc/datacache.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/blackmisc/datacache.cpp b/src/blackmisc/datacache.cpp index f35c7bd08..2fbb77b1d 100644 --- a/src/blackmisc/datacache.cpp +++ b/src/blackmisc/datacache.cpp @@ -87,9 +87,8 @@ namespace BlackMisc if (! QFile::exists(m_revisionFileName)) { QFile(m_revisionFileName).open(QFile::WriteOnly); } m_watcher.addPath(m_revisionFileName); - m_serializer.start(); m_serializer.loadFromStore({}, false, true); // load pinned values - loadFromStoreAsync(); + QTimer::singleShot(0, this, [this] { m_serializer.start(); loadFromStoreAsync(); }); // only start the serializer if the main thread event loop runs } CDataCache *CDataCache::instance()