ProjectExplorer: Fix crash on toolchain re-detection

Fixes: QTCREATORBUG-29430
Change-Id: I8233371f70c3889ef81a3f111c298205712a2838
Reviewed-by: hjk <hjk@qt.io>
This commit is contained in:
Christian Kandeler
2023-07-25 16:31:59 +02:00
parent ad16dba14c
commit 3c58c87585
2 changed files with 6 additions and 3 deletions

View File

@@ -10,6 +10,7 @@
#include <coreplugin/icore.h>
#include <debugger/debuggeritem.h>
#include <debugger/debuggeritemmanager.h>
#include <projectexplorer/devicesupport/devicemanager.h>
#include <projectexplorer/projectexplorerconstants.h>
#include <projectexplorer/toolchain.h>
#include <projectexplorer/toolchainmanager.h>
@@ -447,7 +448,8 @@ static ToolChain *iarToolChain(const FilePath &path, Id language)
== BareMetal::Constants::IAREW_TOOLCHAIN_TYPEID;
});
if (iarFactory) {
Toolchains detected = iarFactory->autoDetect(ToolchainDetector({}, {}, {}));
Toolchains detected = iarFactory->autoDetect(
{{}, DeviceManager::defaultDesktopDevice(), {}});
if (detected.isEmpty())
detected = iarFactory->detectForImport({path, language});
for (auto tc : detected) {