Skip to content

Commit 732da4e

Browse files
committed
Comment out all SafeComWrapper.Release code for stability testing.
1 parent 45d91c8 commit 732da4e

36 files changed

+347
-347
lines changed

RetailCoder.VBE/API/ParserState.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -161,7 +161,7 @@ public void Dispose()
161161
}
162162

163163

164-
_vbe.Release();
164+
//_vbe.Release();
165165
_disposed = true;
166166
}
167167
}

RetailCoder.VBE/Extension.cs

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -240,14 +240,14 @@ private void ShutdownAddIn()
240240
_kernel = null;
241241
}
242242

243-
try
244-
{
245-
_ide.Release();
246-
}
247-
catch (Exception e)
248-
{
249-
_logger.Error(e);
250-
}
243+
//try
244+
//{
245+
// _ide.Release();
246+
//}
247+
//catch (Exception e)
248+
//{
249+
// _logger.Error(e);
250+
//}
251251

252252
GC.WaitForPendingFinalizers();
253253
_isInitialized = false;

RetailCoder.VBE/UI/DockableToolwindowPresenter.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,7 @@ protected virtual void Dispose(bool disposing)
132132
{
133133
// cleanup unmanaged resource wrappers
134134
_window.Close();
135-
_window.Release(true);
135+
//_window.Release(true);
136136
}
137137
if (!disposing)
138138
{

Rubberduck.VBEEditor/SafeComWrappers/Abstract/ISafeComWrapper.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ namespace Rubberduck.VBEditor.SafeComWrappers.Abstract
22
{
33
public interface ISafeComWrapper : INullObjectWrapper
44
{
5-
void Release(bool final = false);
5+
//void Release(bool final = false);
66
}
77

88
public interface ISafeComWrapper<out T> : ISafeComWrapper

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

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -99,14 +99,14 @@ public void Delete()
9999
if (!IsWrappingNullReference) Target.Delete();
100100
}
101101

102-
public override void Release(bool final = false)
103-
{
104-
if (!IsWrappingNullReference)
105-
{
106-
Controls.Release();
107-
base.Release(final);
108-
}
109-
}
102+
//public override void Release(bool final = false)
103+
//{
104+
// if (!IsWrappingNullReference)
105+
// {
106+
// Controls.Release();
107+
// base.Release(final);
108+
// }
109+
//}
110110

111111
public override bool Equals(ISafeComWrapper<Microsoft.Office.Core.CommandBar> other)
112112
{

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ private void Target_Click(Microsoft.Office.Core.CommandBarButton ctrl, ref bool
6666
var args = new CommandBarButtonClickEventArgs(button);
6767
handler.Invoke(this, args);
6868
cancelDefault = args.Cancel;
69-
button.Release(final:true);
69+
//button.Release(final:true);
7070
}
7171

7272
public bool IsBuiltInFace

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

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -53,17 +53,17 @@ IEnumerator IEnumerable.GetEnumerator()
5353
: ((IEnumerable<ICommandBarControl>) this).GetEnumerator();
5454
}
5555

56-
public override void Release(bool final = false)
57-
{
58-
if (!IsWrappingNullReference)
59-
{
60-
for (var i = 1; i <= Count; i++)
61-
{
62-
this[i].Release();
63-
}
64-
base.Release(final);
65-
}
66-
}
56+
//public override void Release(bool final = false)
57+
//{
58+
// if (!IsWrappingNullReference)
59+
// {
60+
// for (var i = 1; i <= Count; i++)
61+
// {
62+
// this[i].Release();
63+
// }
64+
// base.Release(final);
65+
// }
66+
//}
6767

6868
public override bool Equals(ISafeComWrapper<Microsoft.Office.Core.CommandBarControls> other)
6969
{

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

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -29,13 +29,13 @@ public ICommandBarControls Controls
2929
get { return new CommandBarControls(IsWrappingNullReference ? null : Popup.Controls); }
3030
}
3131

32-
public override void Release(bool final = false)
33-
{
34-
if (!IsWrappingNullReference)
35-
{
36-
Controls.Release();
37-
}
38-
base.Release(final);
39-
}
32+
//public override void Release(bool final = false)
33+
//{
34+
// if (!IsWrappingNullReference)
35+
// {
36+
// Controls.Release();
37+
// }
38+
// base.Release(final);
39+
//}
4040
}
4141
}

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

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -77,10 +77,10 @@ public ICommandBar this[object index]
7777
get { return new CommandBar(IsWrappingNullReference ? null : Target[index]); }
7878
}
7979

80-
public override void Release(bool final = false)
81-
{
82-
// important: no-op
83-
}
80+
//public override void Release(bool final = false)
81+
//{
82+
// // important: no-op
83+
//}
8484

8585
public override bool Equals(ISafeComWrapper<Microsoft.Office.Core.CommandBars> other)
8686
{

Rubberduck.VBEEditor/SafeComWrappers/SafeComWrapper.cs

Lines changed: 24 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -13,31 +13,31 @@ protected SafeComWrapper(T target)
1313
_target = target;
1414
}
1515

16-
private bool _isReleased;
17-
public virtual void Release(bool final = false)
18-
{
19-
if (IsWrappingNullReference || _isReleased || !Marshal.IsComObject(Target))
20-
{
21-
_isReleased = true;
22-
return;
23-
}
16+
//private bool _isReleased;
17+
//public virtual void Release(bool final = false)
18+
//{
19+
// if (IsWrappingNullReference || _isReleased || !Marshal.IsComObject(Target))
20+
// {
21+
// _isReleased = true;
22+
// return;
23+
// }
2424

25-
try
26-
{
27-
if (final)
28-
{
29-
Marshal.FinalReleaseComObject(Target);
30-
}
31-
else
32-
{
33-
Marshal.ReleaseComObject(Target);
34-
}
35-
}
36-
finally
37-
{
38-
_isReleased = true;
39-
}
40-
}
25+
// try
26+
// {
27+
// if (final)
28+
// {
29+
// Marshal.FinalReleaseComObject(Target);
30+
// }
31+
// else
32+
// {
33+
// Marshal.ReleaseComObject(Target);
34+
// }
35+
// }
36+
// finally
37+
// {
38+
// _isReleased = true;
39+
// }
40+
//}
4141

4242
public bool IsWrappingNullReference { get { return _target == null; } }
4343
object INullObjectWrapper.Target { get { return _target; } }

0 commit comments

Comments
 (0)