VcsBaseClientImpl: Don't leak VcsCommand instances

The running VcsCommand may leak on shutdown. Make them always
a child of a guard object.

Change-Id: Ie2d07d15cd13f1c08636bb1e9c5face09c6a782d
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
This commit is contained in:
Jarek Kobus
2024-03-18 19:36:43 +01:00
parent 62832ea958
commit d5e8f70192
9 changed files with 23 additions and 12 deletions

View File

@@ -1769,7 +1769,7 @@ VcsCommand *GitPluginPrivate::createInitialCheckoutCommand(const QString &url,
QStringList args = {"clone", "--progress"};
args << extraArgs << url << localName;
auto command = VcsBaseClient::createVcsCommand(baseDirectory,
auto command = VcsBaseClient::createVcsCommand(this, baseDirectory,
gitClient().processEnvironment(baseDirectory));
command->addFlags(RunFlags::SuppressStdErr);
command->addJob({gitClient().vcsBinary(baseDirectory), args}, -1);