Click here to Skip to main content
15,893,814 members
Please Sign up or sign in to vote.
4.64/5 (5 votes)
See more:
I have a simple class that inherits from TextBox and has a member variable
ErrorProvider m_ErrorProvider

ErrorProvider has a dispose method so I've implemented IDisposable and my Dispose method is simply
void IDisposable.Dispose()<br />{<br />    m_ErrorProvider.Dispose();<br />    base.Dispose();<br />}

Is this sufficient?

Posted

1 solution

No.

You should override the bases Dispose(bool disposing) method.

Follow the dispose pattern[^] for a derived class.

 
Share this answer
 


CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900