aboutsummaryrefslogtreecommitdiffstats
path: root/src/lib/corelib/api/jobs.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/lib/corelib/api/jobs.cpp')
-rw-r--r--src/lib/corelib/api/jobs.cpp6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/lib/corelib/api/jobs.cpp b/src/lib/corelib/api/jobs.cpp
index 6b8cf702e..00269d947 100644
--- a/src/lib/corelib/api/jobs.cpp
+++ b/src/lib/corelib/api/jobs.cpp
@@ -252,8 +252,12 @@ void SetupProjectJob::finish()
// The invariant is that there must always be at most one valid Project object
// for the same build directory, so that exclusive ownership of the build graph lock
// is ensured.
- if (m_existingProject.isValid() && !error().hasError())
+ // We also need to invalidate the project if an error has occurred after the build data was
+ // already transferred.
+ if (m_existingProject.isValid()
+ && (!error().hasError() || !m_existingProject.d->internalProject->buildData)) {
m_existingProject.d->internalProject.clear();
+ }
}
/*!