Skip to content

Commit 096362a

Browse files
committed
Merge branch 'next' of https://github.com/rubberduck-vba/Rubberduck into next
2 parents 9ec7848 + f7546c9 commit 096362a

File tree

3 files changed

+13
-6
lines changed

3 files changed

+13
-6
lines changed

RetailCoder.VBE/UI/Command/MenuItems/CommandBars/AppCommandBarBase.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -111,12 +111,12 @@ public void EvaluateCanExecute(RubberduckParserState state)
111111
public void RemoveChildren()
112112
{
113113
// note: doing this wrecks the teardown process. counter-intuitive? sure. but hey it works.
114-
//foreach (var child in _items.Values.Select(item => item as CommandBarButton).Where(child => child != null))
115-
//{
116-
// child.Click -= child_Click;
114+
foreach (var child in _items.Values.Select(item => item as CommandBarButton).Where(child => child != null))
115+
{
116+
child.Click -= child_Click;
117117
// child.Delete();
118118
// child.Release();
119-
//}
119+
}
120120
}
121121

122122
// note: HAAAAACK!!!

RetailCoder.VBE/UI/Command/MenuItems/CommandBars/RubberduckCommandBar.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ public void SetContextSelectionCaption(string caption)
5454
public void Dispose()
5555
{
5656
//note: doing this wrecks the teardown process. counter-intuitive? sure. but hey it works.
57-
//RemoveChildren();
57+
RemoveChildren();
5858
//Item.Delete();
5959
//Item.Release(true);
6060
}

Rubberduck.VBEEditor/SafeComWrappers/Office.Core/CommandBarButton.cs

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,14 @@ public event EventHandler<CommandBarButtonClickEventArgs> Click
3535
}
3636
remove
3737
{
38-
((Microsoft.Office.Core.CommandBarButton)Target).Click -= Target_Click;
38+
try
39+
{
40+
((Microsoft.Office.Core.CommandBarButton)Target).Click -= Target_Click;
41+
}
42+
catch
43+
{
44+
// he's gone, dave.
45+
}
3946
_clickHandler -= value;
4047
}
4148
}

0 commit comments

Comments
 (0)