Any class that overrides the Dispose(bool) method should always call base.Dispose(bool) in the override. This rule verifies that the base method is called.

I wasted a day searching trying to figure out why a form was not being garbage collected. It turned out that somebody removed all the code from the Dispose(bool) override. Since it didn't call base, the form's Dispose(bool) method wasn't being called.

Last edited Sep 6, 2008 at 10:48 PM by JeffLeBert, version 1


No comments yet.