title: How to solve the risk Unreleased Resource: Unmanaged Object(unmanaged_object) via fortify
body: <p>These days, I have a simple C# project which has security risks by the scanning report via fortify. This project is based on the .NET Windows form application. The name of this risk is <code>Unreleased Resource: Unmanaged Object(unmanaged_object)</code>. </p>
  
  <p>For example, if I want to construct label controller by dropping controller figures on the toolbox into the form design. Then modify the font size would change the code in <code>Form1.Designer</code> automatically. For example, it would generates the following code:</p>
  
  <p><code>this.label1.font = new System.Drawing.Font(...)</code></p>
  
  <p>The key is we declare a Font object via the constructor <code>System.Drawing.Font(...)</code>. But we don't dispose this object? So, how do we avoid this risk?</p>
  
  <p>p.s., if we change the code at the area which is generated by visual studio in <code>Form1.Designer</code> file. Then we even can not edit the form anymore~ (Because any setting of controllers (e.g. change the <code>foreColor</code> property of a bottom) would change the code in this part of the file). </p>
  
  <p>Also, we do not want create every controllers in the initialization method. Does anybody has a good way to solve this problem? Thank you very much!!</p>