Steve,
No, the pattern is typically if Dispose is called on an object, and that
object has references to other objects that implement IDisposable, then it
disposes of those objects.
If you have a reference to an implementation of IDisposable and call it,
and another class has a reference to it, that parent class will not be (nor
should it be) disposed of.
Hope this helps.
--
- Nicholas Paldino [.NET/C# MVP]
-
mv*@spam.guard.caspershouse.com
"steve bull" <bu****@comcast.net> wrote in message
news:Oa**************************@4ax.com...
If I have two classes both of which have unmanaged resources that need to
be cleaned up. For example class B is a child of class A
and I create an instance of class B. Then, if I call B.Dispose - Does
A.Dispose get called automatically or do I have to clean up
the unmanaged resource in class A as well in B.Dispose?
Thanks,
Steve