ProjectExplorer: Fix potential race condition

When using BuildStep::runImpl() it was possible for the async part
to still be running while the BuildStep is already deleted.

This change returns the Future so that users can wait for it to finish.

Change-Id: I27c0fc8741c59851c5ab8f5cb858fbcda923c14d
Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
This commit is contained in:
Marcus Tillmanns
2022-11-08 15:08:21 +01:00
parent df946c77dc
commit 06838e3e5e
5 changed files with 15 additions and 5 deletions

View File

@@ -488,7 +488,7 @@ void AndroidDeployQtStep::gatherFilesToPull()
void AndroidDeployQtStep::doRun()
{
runInThread([this] { return runImpl(); });
m_synchronizer.addFuture(runInThread([this] { return runImpl(); }));
}
void AndroidDeployQtStep::runCommand(const CommandLine &command)