Skip to content

Commit 0b9ff4f

Browse files
authored
Update ContainerControlledLifetimeManager.cs
1 parent 69a52cb commit 0b9ff4f

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

src/Lifetime/ContainerControlledLifetimeManager.cs

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,20 @@ public void Dispose()
4242
GC.SuppressFinalize(this);
4343
}
4444

45+
/// <summary>
46+
/// Standard Dispose pattern implementation.
47+
/// </summary>
48+
/// <param name="disposing">Always true, since we don't have a finalizer.</param>
49+
protected virtual void Dispose(bool disposing)
50+
{
51+
if (Value == null) return;
52+
if (Value is IDisposable disposable)
53+
{
54+
disposable.Dispose();
55+
}
56+
Value = null;
57+
}
58+
4559
#endregion
4660
}
4761
}

0 commit comments

Comments
 (0)