Dispose()

csharp United States
  • 17 years ago

    The code below was inserted by the forms designer.  The components variable was set to null also by the forms designer.  I saw no reason to override the Dispose method in this fashion because unless the components variable is not null it would do exactly what I think the regular Dispose method would have been doing.  Can anyone explain how this relates to components and if it is reasonable to delete it?


    /// <summary>
    /// Clean up any resources being used.
    /// </summary>
    protected override void Dispose( bool disposing )
    {
       if( disposing )
       {
           if( components != null )
           components.Dispose();
       }
       base.Dispose( disposing );
    }


    Kyle

Post a reply

No one has replied yet! Why not be the first?

Sign in or Join us (it's free).

Contribute

Why not write for us? Or you could submit an event or a user group in your area. Alternatively just tell us what you think!

Our tools

We've got automatic conversion tools to convert C# to VB.NET, VB.NET to C#. Also you can compress javascript and compress css and generate sql connection strings.

“Perfection is achieved, not when there is nothing more to add, but when there is nothing left to take away.” - Antoine de Saint Exupéry