forked from qt-creator/qt-creator
Python: Fix crash on switching interpreters in run configuration
This happens if the project contains ui files, pyside with pyside uic and the python language server is installed. It is caused by pointers to already deleted extra compilers in the pyls language client. Change-Id: I877f20292c9c850c151fa94149b5a46d4836c3de Reviewed-by: Christian Stenger <christian.stenger@qt.io>
This commit is contained in:
@@ -308,9 +308,10 @@ void PythonRunConfiguration::updateExtraCompilers()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
const FilePath python = aspect<InterpreterAspect>()->currentInterpreter().command;
|
for (LanguageClient::Client *client : LanguageClient::LanguageClientManager::clients()) {
|
||||||
if (auto client = PyLSClient::clientForPython(python))
|
if (auto pylsClient = qobject_cast<PyLSClient *>(client))
|
||||||
client->updateExtraCompilers(project(), m_extraCompilers);
|
pylsClient->updateExtraCompilers(project(), m_extraCompilers);
|
||||||
|
}
|
||||||
qDeleteAll(oldCompilers);
|
qDeleteAll(oldCompilers);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user