diff options
Diffstat (limited to 'src/plugins/projectexplorer/msvctoolchain.cpp')
-rw-r--r-- | src/plugins/projectexplorer/msvctoolchain.cpp | 17 |
1 files changed, 15 insertions, 2 deletions
diff --git a/src/plugins/projectexplorer/msvctoolchain.cpp b/src/plugins/projectexplorer/msvctoolchain.cpp index 95b6bcbdaf..9a68a59689 100644 --- a/src/plugins/projectexplorer/msvctoolchain.cpp +++ b/src/plugins/projectexplorer/msvctoolchain.cpp @@ -26,6 +26,7 @@ #include "msvctoolchain.h" #include "msvcparser.h" +#include "projectexplorer.h" #include "projectexplorerconstants.h" #include "taskhub.h" #include "toolchainmanager.h" @@ -68,6 +69,16 @@ namespace Internal { // Helpers: // -------------------------------------------------------------------------- +static QThreadPool *envModThreadPool() +{ + static QThreadPool *pool = nullptr; + if (!pool) { + pool = new QThreadPool(ProjectExplorerPlugin::instance()); + pool->setMaxThreadCount(1); + } + return pool; +} + struct MsvcPlatform { MsvcToolChain::Platform platform; const char *name; @@ -652,7 +663,8 @@ MsvcToolChain::MsvcToolChain(Core::Id typeId, const QString &name, const Abi &ab : AbstractMsvcToolChain(typeId, l, d, abi, varsBat) , m_varsBatArg(varsBatArg) { - initEnvModWatcher(Utils::runAsync(&MsvcToolChain::environmentModifications, + initEnvModWatcher(Utils::runAsync(envModThreadPool(), + &MsvcToolChain::environmentModifications, varsBat, varsBatArg)); Q_ASSERT(!name.isEmpty()); @@ -744,7 +756,8 @@ bool MsvcToolChain::fromMap(const QVariantMap &data) m_environmentModifications = Utils::EnvironmentItem::itemsFromVariantList( data.value(QLatin1String(environModsKeyC)).toList()); - initEnvModWatcher(Utils::runAsync(&MsvcToolChain::environmentModifications, + initEnvModWatcher(Utils::runAsync(envModThreadPool(), + &MsvcToolChain::environmentModifications, m_vcvarsBat, m_varsBatArg)); return !m_vcvarsBat.isEmpty() && m_abi.isValid(); |