From a64adc4cd114526e57d6091dc9a7528264259e62 Mon Sep 17 00:00:00 2001 From: Orgad Shaneh Date: Thu, 17 Oct 2013 08:54:15 +0300 Subject: [PATCH] Git: Fix crash on show stash * show() is called with a QString reference to the model * And editor is opened, which triggers stateChanged() * stateChanged() updates StashDialog, which refreshes the model with an empty directory (another bug) * The QString name reference is invalidated => crash on access Task-number: QTCREATORBUG-10397 Change-Id: I0c4077f8c4fc90905568f80d1cd89f61c4cd2cba Reviewed-by: Eike Ziller --- src/plugins/git/stashdialog.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/plugins/git/stashdialog.cpp b/src/plugins/git/stashdialog.cpp index ffbf7ecb3fe..fecdedddd85 100644 --- a/src/plugins/git/stashdialog.cpp +++ b/src/plugins/git/stashdialog.cpp @@ -212,7 +212,7 @@ void StashDialog::showCurrent() { const int index = currentRow(); QTC_ASSERT(index >= 0, return); - gitClient()->show(m_repository, m_model->at(index).name); + gitClient()->show(m_repository, QString(m_model->at(index).name)); } // Suggest Branch name to restore 'stash@{0}' -> 'stash0-date'