From a6b17d127af250ae65566e121867071b55f9afe3 Mon Sep 17 00:00:00 2001 From: Jarek Kobus Date: Thu, 8 Dec 2022 14:43:50 +0100 Subject: 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 Reviewed-by: --- src/plugins/git/gitclient.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/plugins/git/gitclient.cpp') 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) -- cgit v1.2.1