Skip to content

Commit 4745a94

Browse files
committed
changed file version; fixed teardown of RubberduckCommandBar
1 parent cc81b7c commit 4745a94

File tree

3 files changed

+22
-3
lines changed

3 files changed

+22
-3
lines changed

RetailCoder.VBE/Properties/AssemblyInfo.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,5 +31,5 @@
3131
// You can specify all the values or you can default the Build and Revision Numbers
3232
// by using the '*' as shown below:
3333
// [assembly: AssemblyVersion("1.0.*")]
34-
[assembly: AssemblyVersion("2.0.8.*")]
35-
[assembly: AssemblyFileVersion("2.0.8.0")]
34+
[assembly: AssemblyVersion("2.0.9.*")]
35+
[assembly: AssemblyFileVersion("2.0.9.0")]

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

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
using System;
2-
using Rubberduck.Parsing;
32
using Rubberduck.Parsing.Symbols;
43
using Rubberduck.Parsing.VBA;
54
using Rubberduck.Properties;
@@ -176,7 +175,22 @@ public void Dispose()
176175
return;
177176
}
178177

178+
_refreshButton.Click -= refreshButton_Click;
179+
((CommandBarButton)_refreshButton).StopEvents();
180+
179181
_state.StateChanged -= State_StateChanged;
182+
((CommandBarButton)_statusButton).StopEvents();
183+
184+
_refreshButton.Delete();
185+
_statusButton.Delete();
186+
_selectionButton.Delete();
187+
188+
_refreshButton.Release();
189+
_statusButton.Release();
190+
_selectionButton.Release();
191+
192+
_commandbar.Delete();
193+
180194
_isDisposed = true;
181195
}
182196
}

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

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,11 @@ public void HandleEvents()
2020
((Microsoft.Office.Core.CommandBarButton)Target).Click += Target_Click;
2121
}
2222

23+
public void StopEvents()
24+
{
25+
((Microsoft.Office.Core.CommandBarButton)Target).Click -= Target_Click;
26+
}
27+
2328
private Microsoft.Office.Core.CommandBarButton Button
2429
{
2530
get { return (Microsoft.Office.Core.CommandBarButton)Target; }

0 commit comments

Comments
 (0)