diff options
author | Lluis Sanchez <lluis@xamarin.com> | 2020-01-14 11:21:43 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-01-14 11:21:43 +0300 |
commit | f2af08074ebfa87ef619fa30be3bb46e635c571b (patch) | |
tree | 493479fba5ff80ff25bd1d9810a054aeb646bd35 /main | |
parent | e06b14958027fe30c389c79636f1e5f516934950 (diff) | |
parent | 65dfdeafffaf53491bcdc22b544098ad80edba3d (diff) |
Merge pull request #9535 from mono/backport-pr-9534-to-release-8.4
[release-8.4] [Ide] Fix crash in main toolbar after project is reloaded
Diffstat (limited to 'main')
-rw-r--r-- | main/src/core/MonoDevelop.Ide/MonoDevelop.Components.MainToolbar/MainToolbarController.cs | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.MainToolbar/MainToolbarController.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.MainToolbar/MainToolbarController.cs index a9763a1510..62986247a3 100644 --- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.MainToolbar/MainToolbarController.cs +++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.MainToolbar/MainToolbarController.cs @@ -574,6 +574,7 @@ namespace MonoDevelop.Components.MainToolbar currentSolution.StartupConfigurationChanged -= HandleStartupItemChanged; currentSolution.Saved -= HandleSolutionSaved; currentSolution.EntrySaved -= HandleSolutionEntrySaved; + currentSolution.SolutionItemAdded -= HandleSolutionItemAdded; } currentSolution = e.Solution; @@ -582,6 +583,7 @@ namespace MonoDevelop.Components.MainToolbar currentSolution.StartupConfigurationChanged += HandleStartupItemChanged; currentSolution.Saved += HandleSolutionSaved; currentSolution.EntrySaved += HandleSolutionEntrySaved; + currentSolution.SolutionItemAdded += HandleSolutionItemAdded; } TrackStartupProject (); @@ -624,6 +626,14 @@ namespace MonoDevelop.Components.MainToolbar HandleSolutionSaved (sender, e); } + void HandleSolutionItemAdded (object sender, SolutionItemChangeEventArgs e) + { + // When a solution item is added due to a reload we need to ensure the configurationMergers dictionary is + // using the new project and not the old disposed project. + if (e.Reloading) + UpdateCombos (); + } + void HandleStartupItemChanged (object sender, EventArgs e) { TrackStartupProject (); |