From ffa686782af8c494a3c96967e22c0307c10b1b80 Mon Sep 17 00:00:00 2001 From: Christian Kandeler Date: Tue, 9 Sep 2014 15:32:20 +0200 Subject: Do not clear Artifact::product in removeArtifact(). This is too early in the case of change tracking; we still do a couple of things with the old build data afterwards. Change-Id: I843e364288ed7b05bcb7d03386c102212ec18690 Reviewed-by: Joerg Bornemann --- src/lib/corelib/buildgraph/buildgraphloader.cpp | 5 +++++ src/lib/corelib/buildgraph/projectbuilddata.cpp | 1 - 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/src/lib/corelib/buildgraph/buildgraphloader.cpp b/src/lib/corelib/buildgraph/buildgraphloader.cpp index 62749643a..6f1b62212 100644 --- a/src/lib/corelib/buildgraph/buildgraphloader.cpp +++ b/src/lib/corelib/buildgraph/buildgraphloader.cpp @@ -336,6 +336,11 @@ void BuildGraphLoader::trackProjectChanges() EmptyDirectoriesRemover(m_result.newlyResolvedProject.data(), m_logger) .removeEmptyParentDirectories(m_artifactsRemovedFromDisk); + foreach (FileResourceBase * const f, m_objectsToDelete) { + Artifact * const a = dynamic_cast(f); + if (a) + a->product.clear(); // To help with the sanity checks. + } doSanityChecks(m_result.newlyResolvedProject, m_logger); } diff --git a/src/lib/corelib/buildgraph/projectbuilddata.cpp b/src/lib/corelib/buildgraph/projectbuilddata.cpp index c53cb9311..bc0babb9f 100644 --- a/src/lib/corelib/buildgraph/projectbuilddata.cpp +++ b/src/lib/corelib/buildgraph/projectbuilddata.cpp @@ -299,7 +299,6 @@ void ProjectBuildData::removeArtifact(Artifact *artifact, artifact->product->buildData->nodes.remove(artifact); artifact->product->buildData->roots.remove(artifact); removeArtifactFromSet(artifact, artifact->product->buildData->artifactsByFileTag); - artifact->product.clear(); } isDirty = true; } -- cgit v1.2.3