forked from qt-creator/qt-creator
Git: Fix crash on quit while rebase-todo editor is open
Change-Id: I458cbb2168642f226583b406e34596d223c7d5ea Reviewed-by: Tobias Hunger <tobias.hunger@digia.com>
This commit is contained in:
committed by
Orgad Shaneh
parent
15a9019191
commit
3be6065b04
@@ -687,7 +687,10 @@ public:
|
|||||||
|
|
||||||
~ConflictHandler()
|
~ConflictHandler()
|
||||||
{
|
{
|
||||||
GitClient *client = GitPlugin::instance()->gitClient();
|
// If interactive rebase editor window is closed, plugin is terminated
|
||||||
|
// but referenced here when the command ends
|
||||||
|
if (GitPlugin *plugin = GitPlugin::instance()) {
|
||||||
|
GitClient *client = plugin->gitClient();
|
||||||
if (m_commit.isEmpty() && m_files.isEmpty()) {
|
if (m_commit.isEmpty() && m_files.isEmpty()) {
|
||||||
if (client->checkCommandInProgress(m_workingDirectory) == GitClient::NoCommand)
|
if (client->checkCommandInProgress(m_workingDirectory) == GitClient::NoCommand)
|
||||||
client->endStashScope(m_workingDirectory);
|
client->endStashScope(m_workingDirectory);
|
||||||
@@ -695,6 +698,7 @@ public:
|
|||||||
client->handleMergeConflicts(m_workingDirectory, m_commit, m_files, m_command);
|
client->handleMergeConflicts(m_workingDirectory, m_commit, m_files, m_command);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
void readStdOutString(const QString &data)
|
void readStdOutString(const QString &data)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -33,6 +33,7 @@
|
|||||||
#include <coreplugin/progressmanager/progressmanager.h>
|
#include <coreplugin/progressmanager/progressmanager.h>
|
||||||
#include <coreplugin/vcsmanager.h>
|
#include <coreplugin/vcsmanager.h>
|
||||||
#include <utils/synchronousprocess.h>
|
#include <utils/synchronousprocess.h>
|
||||||
|
#include <utils/runextensions.h>
|
||||||
|
|
||||||
#include <QDebug>
|
#include <QDebug>
|
||||||
#include <QProcess>
|
#include <QProcess>
|
||||||
@@ -202,7 +203,7 @@ void Command::execute()
|
|||||||
return;
|
return;
|
||||||
|
|
||||||
// For some reason QtConcurrent::run() only works on this
|
// For some reason QtConcurrent::run() only works on this
|
||||||
QFuture<void> task = QtConcurrent::run(this, &Command::run);
|
QFuture<void> task = QtConcurrent::run(&Command::run, this);
|
||||||
QString binary = QFileInfo(d->m_binaryPath).baseName();
|
QString binary = QFileInfo(d->m_binaryPath).baseName();
|
||||||
if (!binary.isEmpty())
|
if (!binary.isEmpty())
|
||||||
binary = binary.replace(0, 1, binary[0].toUpper()); // Upper the first letter
|
binary = binary.replace(0, 1, binary[0].toUpper()); // Upper the first letter
|
||||||
@@ -226,7 +227,7 @@ QString Command::msgTimeout(int seconds)
|
|||||||
return tr("Error: VCS timed out after %1s.").arg(seconds);
|
return tr("Error: VCS timed out after %1s.").arg(seconds);
|
||||||
}
|
}
|
||||||
|
|
||||||
void Command::run()
|
void Command::run(QFutureInterface<void> &future)
|
||||||
{
|
{
|
||||||
// Check that the binary path is not empty
|
// Check that the binary path is not empty
|
||||||
if (binaryPath().trimmed().isEmpty()) {
|
if (binaryPath().trimmed().isEmpty()) {
|
||||||
@@ -284,6 +285,7 @@ void Command::run()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (!future.isCanceled()) {
|
||||||
if (ok && d->m_jobs.front().arguments.at(0) == QLatin1String("status"))
|
if (ok && d->m_jobs.front().arguments.at(0) == QLatin1String("status"))
|
||||||
removeColorCodes(&stdOut);
|
removeColorCodes(&stdOut);
|
||||||
|
|
||||||
@@ -302,6 +304,7 @@ void Command::run()
|
|||||||
if (d->m_expectChanges)
|
if (d->m_expectChanges)
|
||||||
Core::ICore::vcsManager()->emitRepositoryChanged(d->m_workingDirectory);
|
Core::ICore::vcsManager()->emitRepositoryChanged(d->m_workingDirectory);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// As it is used asynchronously, we need to delete ourselves
|
// As it is used asynchronously, we need to delete ourselves
|
||||||
this->deleteLater();
|
this->deleteLater();
|
||||||
|
|||||||
@@ -34,9 +34,13 @@
|
|||||||
|
|
||||||
#include <QObject>
|
#include <QObject>
|
||||||
|
|
||||||
QT_FORWARD_DECLARE_CLASS(QStringList)
|
QT_BEGIN_NAMESPACE
|
||||||
QT_FORWARD_DECLARE_CLASS(QVariant)
|
class QStringList;
|
||||||
QT_FORWARD_DECLARE_CLASS(QProcessEnvironment)
|
class QVariant;
|
||||||
|
class QProcessEnvironment;
|
||||||
|
template <typename T>
|
||||||
|
class QFutureInterface;
|
||||||
|
QT_END_NAMESPACE
|
||||||
|
|
||||||
namespace VcsBase {
|
namespace VcsBase {
|
||||||
|
|
||||||
@@ -94,7 +98,7 @@ public:
|
|||||||
void setCookie(const QVariant &cookie);
|
void setCookie(const QVariant &cookie);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
void run();
|
void run(QFutureInterface<void> &future);
|
||||||
|
|
||||||
signals:
|
signals:
|
||||||
void outputData(const QByteArray &);
|
void outputData(const QByteArray &);
|
||||||
|
|||||||
Reference in New Issue
Block a user