Skip to content

Commit 4c06388

Browse files
authored
Merge pull request #4473 from bclothier/FixComSafeDisposal
Fix up the Dispose methods
2 parents 7391f83 + 4ca6d8a commit 4c06388

File tree

3 files changed

+5
-2
lines changed

3 files changed

+5
-2
lines changed

Rubberduck.VBEEditor/ComManagement/ComSafeBase.cs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,10 @@ protected int GetComWrapperObjectHashCode(ISafeComWrapper comWrapper)
2828
public void Dispose()
2929
{
3030
Dispose(true);
31+
}
3132

33+
protected virtual void Dispose(bool disposing)
34+
{
3235
#if DEBUG
3336
if (_disposed)
3437
{
@@ -67,8 +70,6 @@ public void Dispose()
6770
#endif
6871
}
6972

70-
protected abstract void Dispose(bool disposing);
71-
7273
#if DEBUG
7374
private struct TraceData
7475
{

Rubberduck.VBEEditor/ComManagement/StrongComSafe.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,7 @@ protected override void Dispose(bool disposing)
5757
}
5858

5959
_disposed = true;
60+
base.Dispose(disposing);
6061

6162
foreach (var comWrapper in _comWrapperCache.Keys)
6263
{

Rubberduck.VBEEditor/ComManagement/WeakComSafe.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,7 @@ protected override void Dispose(bool disposing)
6161
}
6262

6363
_disposed = true;
64+
base.Dispose(disposing);
6465

6566
foreach (var weakReference in _comWrapperCache.Values)
6667
{

0 commit comments

Comments
 (0)