Browse Source

Fix DockWorkspace initialization in release mode: make initialization explicit.

pull/2554/head
Siegfried Pammer 4 years ago
parent
commit
aafb7d5343
  1. 7
      ILSpy/Docking/DockWorkspace.cs
  2. 2
      ILSpy/MainWindow.xaml.cs

7
ILSpy/Docking/DockWorkspace.cs

@ -46,12 +46,13 @@ namespace ICSharpCode.ILSpy.Docking @@ -46,12 +46,13 @@ namespace ICSharpCode.ILSpy.Docking
public event PropertyChangedEventHandler PropertyChanged;
public static DockWorkspace Instance { get; } = new DockWorkspace();
public static DockWorkspace Instance { get; private set; }
private DockWorkspace()
internal DockWorkspace(MainWindow parent)
{
Instance = this;
this.TabPages.CollectionChanged += Documents_CollectionChanged;
MainWindow.Instance.CurrentAssemblyListChanged += MainWindow_Instance_CurrentAssemblyListChanged;
parent.CurrentAssemblyListChanged += MainWindow_Instance_CurrentAssemblyListChanged;
}
private void MainWindow_Instance_CurrentAssemblyListChanged(object sender, NotifyCollectionChangedEventArgs e)

2
ILSpy/MainWindow.xaml.cs

@ -109,7 +109,7 @@ namespace ICSharpCode.ILSpy @@ -109,7 +109,7 @@ namespace ICSharpCode.ILSpy
this.Icon = Images.ILSpyIcon;
this.DataContext = new MainWindowViewModel {
Workspace = DockWorkspace.Instance,
Workspace = new DockWorkspace(this),
SessionSettings = sessionSettings,
AssemblyListManager = AssemblyListManager
};

Loading…
Cancel
Save