diff --git a/src/plugins/python/pythonutils.cpp b/src/plugins/python/pythonutils.cpp index af1c42b5ab9..f679fe2b0fa 100644 --- a/src/plugins/python/pythonutils.cpp +++ b/src/plugins/python/pythonutils.cpp @@ -98,6 +98,8 @@ static QString pythonName(const FilePath &pythonPath) FilePath getPylsModulePath(CommandLine pylsCommand) { + static QMutex mutex; // protect the access to the cache + QMutexLocker locker(&mutex); static QMap cache; const FilePath &modulePath = cache.value(pylsCommand.executable()); if (!modulePath.isEmpty())