ProjectImporter: Fix deletion of directory data

Change-Id: I33c4fc25ab9c85dd8433281e2915a7d9428ea40b
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
This commit is contained in:
Tobias Hunger
2016-09-16 14:13:02 +02:00
parent 080d2dad65
commit a9652dad69
4 changed files with 11 additions and 1 deletions

View File

@@ -131,7 +131,9 @@ QList<BuildInfo *> ProjectImporter::import(const Utils::FileName &importPath, bo
}
}
qDeleteAll(dataList);
foreach (auto *dd, dataList)
deleteDirectoryData(dd);
dataList.clear();
if (result.isEmpty() && !silent)
QMessageBox::critical(Core::ICore::mainWindow(),

View File

@@ -86,6 +86,8 @@ protected:
// will get one of the results from examineDirectory
virtual QList<BuildInfo *> buildInfoListForKit(const Kit *k, void *directoryData) const = 0;
virtual void deleteDirectoryData(void *directoryData) const = 0;
using KitSetupFunction = std::function<void(Kit *)>;
ProjectExplorer::Kit *createTemporaryKit(const KitSetupFunction &setup) const;

View File

@@ -265,6 +265,11 @@ QList<BuildInfo *> QmakeProjectImporter::buildInfoListForKit(const Kit *k, void
return result;
}
void QmakeProjectImporter::deleteDirectoryData(void *directoryData) const
{
delete static_cast<DirectoryData *>(directoryData);
}
static ToolChain *preferredToolChain(BaseQtVersion *qtVersion, const FileName &ms,
const QMakeStepConfig::TargetArchConfig &archConfig)
{

View File

@@ -52,6 +52,7 @@ private:
QList<ProjectExplorer::BuildInfo *> buildInfoListForKit(const ProjectExplorer::Kit *k,
void *directoryData) const final;
void deleteDirectoryData(void *directoryData) const final;
ProjectExplorer::Kit *createTemporaryKit(const QtProjectImporter::QtVersionData &data,
const Utils::FileName &parsedSpec,