File tree Expand file tree Collapse file tree 6 files changed +31
-28
lines changed
Rubberduck.VBEEditor/SafeComWrappers Expand file tree Collapse file tree 6 files changed +31
-28
lines changed Original file line number Diff line number Diff line change @@ -42,11 +42,12 @@ public void Localize()
42
42
43
43
public void Dispose ( )
44
44
{
45
- foreach ( var menu in _menus . Where ( menu => menu . Item != null ) )
46
- {
47
- menu . RemoveChildren ( ) ;
48
- menu . Item . Delete ( ) ;
49
- }
45
+ // note: doing this wrecks the teardown process. counter-intuitive? sure. but hey it works.
46
+ //foreach (var menu in _menus.Where(menu => menu.Item != null))
47
+ //{
48
+ // menu.RemoveChildren();
49
+ // menu.Item.Delete();
50
+ //}
50
51
}
51
52
}
52
53
}
Original file line number Diff line number Diff line change @@ -110,12 +110,13 @@ public void EvaluateCanExecute(RubberduckParserState state)
110
110
public ICommandBar Item { get ; private set ; }
111
111
public void RemoveChildren ( )
112
112
{
113
- foreach ( var child in _items . Values . Select ( item => item as CommandBarButton ) . Where ( child => child != null ) )
114
- {
115
- child . Click -= child_Click ;
116
- child . Delete ( ) ;
117
- //child.Release();
118
- }
113
+ // 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;
117
+ // child.Delete();
118
+ // child.Release();
119
+ //}
119
120
}
120
121
121
122
// note: HAAAAACK!!!
Original file line number Diff line number Diff line change @@ -53,9 +53,10 @@ public void SetContextSelectionCaption(string caption)
53
53
54
54
public void Dispose ( )
55
55
{
56
- RemoveChildren ( ) ;
57
- Item . Delete ( ) ;
58
- Item . Release ( true ) ;
56
+ //note: doing this wrecks the teardown process. counter-intuitive? sure. but hey it works.
57
+ //RemoveChildren();
58
+ //Item.Delete();
59
+ //Item.Release(true);
59
60
}
60
61
}
61
62
Original file line number Diff line number Diff line change @@ -96,14 +96,14 @@ public void RemoveChildren()
96
96
foreach ( var child in _items . Keys . Select ( item => item as IParentMenuItem ) . Where ( child => child != null ) )
97
97
{
98
98
child . RemoveChildren ( ) ;
99
- var item = _items [ child ] ;
100
- Debug . Assert ( item is CommandBarPopup ) ;
101
- ( item as CommandBarPopup ) . Delete ( ) ;
99
+ // var item = _items[child];
100
+ // Debug.Assert(item is CommandBarPopup);
101
+ // (item as CommandBarPopup).Delete();
102
102
}
103
103
foreach ( var child in _items . Values . Select ( item => item as CommandBarButton ) . Where ( child => child != null ) )
104
104
{
105
105
child . Click -= child_Click ;
106
- child . Delete ( ) ;
106
+ // child.Delete();
107
107
}
108
108
}
109
109
Original file line number Diff line number Diff line change @@ -77,15 +77,15 @@ public ICommandBar this[object index]
77
77
78
78
public override void Release ( bool final = false )
79
79
{
80
- if ( ! IsWrappingNullReference )
81
- {
82
- var commandBars = this . ToArray ( ) ;
83
- foreach ( var commandBar in commandBars )
84
- {
85
- commandBar . Release ( ) ;
86
- }
87
- base . Release ( final ) ;
88
- }
80
+ // if (!IsWrappingNullReference)
81
+ // {
82
+ // var commandBars = this.ToArray();
83
+ // foreach (var commandBar in commandBars)
84
+ // {
85
+ // commandBar.Release();
86
+ // }
87
+ // base.Release(final);
88
+ // }
89
89
}
90
90
91
91
public override bool Equals ( ISafeComWrapper < Microsoft . Office . Core . CommandBars > other )
Original file line number Diff line number Diff line change @@ -90,7 +90,7 @@ public override void Release(bool final = false)
90
90
{
91
91
VBProjects . Release ( ) ;
92
92
CodePanes . Release ( ) ;
93
- CommandBars . Release ( ) ;
93
+ // CommandBars.Release();
94
94
Windows . Release ( ) ;
95
95
AddIns . Release ( ) ;
96
96
base . Release ( final ) ;
You can’t perform that action at this time.
0 commit comments