Fix a possible crash on shutdown while executing VcsCommand

Add a global synchronizer to the VcsPlugin.

Fixes: QTCREATORBUG-25744
Change-Id: I97578f4a5b5275071aa0253a22fc9ab2f90d9b75
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
This commit is contained in:
Jarek Kobus
2021-06-01 16:00:54 +02:00
parent b730aa6405
commit bcd3feeaa7
4 changed files with 22 additions and 0 deletions

View File

@@ -26,6 +26,7 @@
#include "vcscommand.h"
#include "vcsbaseplugin.h"
#include "vcsoutputwindow.h"
#include "vcsplugin.h"
#include <coreplugin/documentmanager.h>
#include <coreplugin/vcsmanager.h>
@@ -78,6 +79,12 @@ void VcsCommand::runCommand(SynchronousProcess &proc,
emitRepositoryChanged(workingDirectory);
}
void VcsCommand::addTask(QFuture<void> &future)
{
Core::ShellCommand::addTask(future);
Internal::VcsPlugin::addFuture(future);
}
void VcsCommand::emitRepositoryChanged(const QString &workingDirectory)
{
if (m_preventRepositoryChanged || !(flags() & VcsCommand::ExpectRepoChanges))