Dispose Question

  • Thread starter Thread starter Scott Hembrough
  • Start date Start date
S

Scott Hembrough

Just a quick question on implementing the Dispose pattern.

The .NET Framework SDK documentation states that an ObjectDisposedException
should be thrown from instance methods (other than Dispose) when resources
for the object have already been disposed. This would include any
non-shared property procedures as well, right? Seems logical. Just looking
for verification.

Thanks!
 
I had a discussion with one of the CLR devs on his blog about this and he said in effect "well mostly"

What about a property called IsClosed or a an operator overload? I think there is a broad approach that what the documentation says is correct however there are exceptions (aren't there always)

Regards

Richard Blewett - DevelopMentor
http://www.dotnetconsult.co.uk/weblog
http://www.dotnetconsult.co.uk

Just a quick question on implementing the Dispose pattern.

The .NET Framework SDK documentation states that an ObjectDisposedException
should be thrown from instance methods (other than Dispose) when resources
for the object have already been disposed. This would include any
non-shared property procedures as well, right? Seems logical. Just looking
for verification.

Thanks!
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top