C
cgarcia0117
For any class I write in C# that has a member variable that implements
IDisposable my class implements the IDisposable pattern. I do this to
guarantee the reference to the member is explicitly released and the
object is eligible for garbage collection when my class is disposed or
its' finalizer is called by GC.
My question is whether using this approach is even necessary? My
feeling is yes because it ensures the member is explicitly Disposed
when my Class is, but I'm not certain it provides any real benefit
since the GC will release the reference when it eventually gets to it.
Thanks for the input.
IDisposable my class implements the IDisposable pattern. I do this to
guarantee the reference to the member is explicitly released and the
object is eligible for garbage collection when my class is disposed or
its' finalizer is called by GC.
My question is whether using this approach is even necessary? My
feeling is yes because it ensures the member is explicitly Disposed
when my Class is, but I'm not certain it provides any real benefit
since the GC will release the reference when it eventually gets to it.
Thanks for the input.