From 65ba1bf91a94a415eb233f98284f507b32ead94a Mon Sep 17 00:00:00 2001 From: Daniel Grunwald Date: Sat, 27 Oct 2007 16:56:20 +0000 Subject: [PATCH] Prevent crash in DockPanel.FocusManager.Activate when active pane was removed (e.g. the pad that was active when SharpDevelop was closed does not exist anymore after an AddIn was removed manually or SharpDevelop was updated) git-svn-id: svn://svn.sharpdevelop.net/sharpdevelop/trunk@2732 1ccf3a8d-04fe-1044-b7c0-cef0b8235c61 --- data/resources/layouts/Debug.xml | 178 +++++++++--------- data/resources/layouts/Default.xml | 146 +++++++------- .../project/CSharp/DefaultAssemblyInfo.cs | 2 +- .../Docking/DockPanel.FocusManager.cs | 3 + src/Libraries/DockPanel_Src/patchnotes.txt | 6 + 5 files changed, 166 insertions(+), 169 deletions(-) diff --git a/data/resources/layouts/Debug.xml b/data/resources/layouts/Debug.xml index 5d8526db58..1df7b8e2fe 100644 --- a/data/resources/layouts/Debug.xml +++ b/data/resources/layouts/Debug.xml @@ -1,145 +1,137 @@  - - - - + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + - + - + - - - + + - - + + - - - - - - - - - + + + + + + + + + + + + - - - - + + + + - - - - - - - - - - - - + + + + + + + + + + + - + - - - - - - - - - - + + + + - - - + - + - + - + - - + + - + - + - + - - + + - + - - + + - + - - + + - + \ No newline at end of file diff --git a/data/resources/layouts/Default.xml b/data/resources/layouts/Default.xml index 01b5c6a861..6c770f5044 100644 --- a/data/resources/layouts/Default.xml +++ b/data/resources/layouts/Default.xml @@ -1,121 +1,117 @@  - - + + - + - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + - + - + - - - - - + + + + + - - + + - - - - - + + + + + - - - - - - - - - - - + + + + + + + + + + - - - - - - - - - + + + + + + + + - + - + - + - + - + - + - + - + - - + + - + \ No newline at end of file diff --git a/data/templates/project/CSharp/DefaultAssemblyInfo.cs b/data/templates/project/CSharp/DefaultAssemblyInfo.cs index 79c4fea55a..5da5851146 100644 --- a/data/templates/project/CSharp/DefaultAssemblyInfo.cs +++ b/data/templates/project/CSharp/DefaultAssemblyInfo.cs @@ -1,7 +1,7 @@ #region Using directives +using System; using System.Reflection; -using System.Runtime.CompilerServices; using System.Runtime.InteropServices; #endregion diff --git a/src/Libraries/DockPanel_Src/WinFormsUI/Docking/DockPanel.FocusManager.cs b/src/Libraries/DockPanel_Src/WinFormsUI/Docking/DockPanel.FocusManager.cs index 6ab5d021e8..5d9835f8d6 100644 --- a/src/Libraries/DockPanel_Src/WinFormsUI/Docking/DockPanel.FocusManager.cs +++ b/src/Libraries/DockPanel_Src/WinFormsUI/Docking/DockPanel.FocusManager.cs @@ -165,6 +165,9 @@ namespace WeifenLuo.WinFormsUI.Docking ContentActivating = content; return; } + + if (content.IsDisposed) + return; DockContentHandler handler = content.DockHandler; if (ContentContains(content, handler.ActiveWindowHandle)) diff --git a/src/Libraries/DockPanel_Src/patchnotes.txt b/src/Libraries/DockPanel_Src/patchnotes.txt index fc607022c2..cc0a27b5a8 100644 --- a/src/Libraries/DockPanel_Src/patchnotes.txt +++ b/src/Libraries/DockPanel_Src/patchnotes.txt @@ -8,3 +8,9 @@ Patch #1: Remove redundant finalizers - in AutoHideStripBase.cs, DockPaneStripBase.cs Changed background color of inactive pads. - in VS2005DockPaneCaption.cs, VS2005DockPaneStip.cs Committed in revision 2706. + +Patch #2: + Prevent crash in DockPanel.FocusManager.Activate when active pane was removed (e.g. the pad + that was active when SharpDevelop was closed does not exist anymore after an AddIn was removed + manually or SharpDevelop was updated) + Committed in revision 2732.