Let's say I have a disposable object MyDisposable
whom take as a constructor parameter another disposable object.
using(MyDisposable myDisposable= new MyDisposable(new AnotherDisposable()))
{
//whatever
}
Assuming myDisposable
don't dispose the AnotherDisposable
inside it's dispose method.
Does this only dispose correctly myDisposable
? or it dispose the AnotherDisposable
too?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…