diff options
author | Jarek Kobus <jaroslaw.kobus@qt.io> | 2022-12-08 14:43:50 +0100 |
---|---|---|
committer | Jarek Kobus <jaroslaw.kobus@qt.io> | 2022-12-08 20:54:49 +0000 |
commit | a6b17d127af250ae65566e121867071b55f9afe3 (patch) | |
tree | b6fa62de4771d708cb2bd962de2c5e77907725a4 /src/plugins/git/gitclient.cpp | |
parent | 533d9697356761e95bb33ab5188ae1b58a6bba39 (diff) | |
download | qt-creator-a6b17d127af250ae65566e121867071b55f9afe3.tar.gz |
VcsBase, Git: Don't use queued connections to VcsCommand
Otherwise, the destructor of VcsCommand could have been
executed in meantime (since it's invoked automatically
after done()) and we might access invalid pointer to the
command inside the done handler.
Change-Id: I031e2281952451d4e01c47f437097a1e7bf8899f
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Diffstat (limited to 'src/plugins/git/gitclient.cpp')
-rw-r--r-- | src/plugins/git/gitclient.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/plugins/git/gitclient.cpp b/src/plugins/git/gitclient.cpp index a13a23deaa..220d0de71e 100644 --- a/src/plugins/git/gitclient.cpp +++ b/src/plugins/git/gitclient.cpp @@ -1108,8 +1108,8 @@ void GitClient::status(const FilePath &workingDirectory) const { VcsOutputWindow::setRepository(workingDirectory); VcsCommand *command = vcsExec(workingDirectory, {"status", "-u"}, nullptr, true); - connect(command, &VcsCommand::done, VcsOutputWindow::instance(), - &VcsOutputWindow::clearRepository, Qt::QueuedConnection); + connect(command, &VcsCommand::done, + VcsOutputWindow::instance(), &VcsOutputWindow::clearRepository); } static QStringList normalLogArguments() @@ -3113,7 +3113,7 @@ void GitClient::pull(const FilePath &workingDirectory, bool rebase) connect(command, &VcsCommand::done, this, [this, workingDirectory, command] { if (command->result() == ProcessResult::FinishedWithSuccess) updateSubmodulesIfNeeded(workingDirectory, true); - }, Qt::QueuedConnection); + }); } void GitClient::synchronousAbortCommand(const FilePath &workingDir, const QString &abortCommand) |