From 7267c95acfd9364bf2eaaf175878670762373c7c Mon Sep 17 00:00:00 2001
From: jkobus <jaroslaw.kobus@digia.com>
Date: Mon, 10 Feb 2014 16:38:55 +0100
Subject: [PATCH] Fix a crash on "Switch to Text Diff Editor"

Task-number: QTCREATORBUG-11448

Change-Id: Id0239d5cf71ff857ac384e18136348df92a98b74
Reviewed-by: Eike Ziller <eike.ziller@digia.com>
---
 src/plugins/git/gitclient.cpp | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/src/plugins/git/gitclient.cpp b/src/plugins/git/gitclient.cpp
index 04dbd77f394..84bcc149fdb 100644
--- a/src/plugins/git/gitclient.cpp
+++ b/src/plugins/git/gitclient.cpp
@@ -122,7 +122,9 @@ public:
 
         QAction *switchAction = new QAction(actionIcon, actionToolTip, parentEditor);
         parentEditor->toolBar()->addAction(switchAction);
-        connect(switchAction, SIGNAL(triggered()), this, SLOT(execute()));
+
+        // must be queued connection because execute() removes the editor & tool bar that the action was added to
+        connect(switchAction, SIGNAL(triggered()), this, SLOT(execute()), Qt::QueuedConnection);
     }
 
     void setWorkingDirectory(const QString &workingDir) { m_workingDirectory = workingDir; }
-- 
GitLab