Background
In Visual Studio 2008 Create a new Windows Forms application, this will create a skeleton project with the class "Form1". VS2008 automatically creates the Dispose () method.
/// <summary> /// Clean up any resources being used. /// </summary> /// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param> protected override void Dispose(bool disposing) { if (disposing && (components != null)) { components.Dispose(); } base.Dispose(disposing); }
I wandered into the office of a colleague (senior developer) - a great guy, smart, good design for chat - but I noticed that he was typing - when he switched to the code base, he deleted this section of the Dispose () methods that VS2008 was created for forms.
if (disposing && (components != null)) { components.Dispose(); }
So, I asked him why, and he said that he did not need to be stored.
Questions
- Is it safe to delete this code?
- What are the advantages / disadvantages of leaving or removing it?
source share