From 5e5b90a9a1664ca262b4016d27f5f639e81e2457 Mon Sep 17 00:00:00 2001 From: hjk Date: Tue, 25 Jul 2023 15:19:25 +0200 Subject: [PATCH] Git: Switch order of GitClient and GerritPlugin construction The GerritPlugin constructor calls GerritParameters::fromSettings() which then calls calls detectApp() if there is no curl (or no ssh/GIT_SSH). On Windows this ends up calling GitClient::instance()->gitBinDirectory() which crashes as the GitClent instance does not exist at this time. Work around by switching the construction order. Change-Id: I0b1172d6b7ec96502a51684578b78042a42a95ca Reviewed-by: Orgad Shaneh --- src/plugins/git/gitplugin.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/plugins/git/gitplugin.cpp b/src/plugins/git/gitplugin.cpp index c5f30fa036f..3c1affca33f 100644 --- a/src/plugins/git/gitplugin.cpp +++ b/src/plugins/git/gitplugin.cpp @@ -421,9 +421,10 @@ public: QVector m_projectActions; QVector m_repositoryActions; ParameterAction *m_applyCurrentFilePatchAction = nullptr; - Gerrit::Internal::GerritPlugin m_gerritPlugin; GitClient m_gitClient; + Gerrit::Internal::GerritPlugin m_gerritPlugin; + QPointer m_stashDialog; BranchViewFactory m_branchViewFactory; QPointer m_remoteDialog;