title: Should I dispose of the old font when changing the font of a control?
body: <p>C#, Windows Forms app.</p>
  
  <p>We're re-skinning our application and I'm also changing the awful default font we used in the old one. So I thought I'd call the following function to change the font of all controls on a form when the form is loaded. </p>
  
  <pre><code>  internal static void SetFonts(Control control)
    {
      Font oldFont = control.Font;
      if (oldFont.Name != GlobalFontName)
      {
        string familyName = GlobalFontName;
        Font newFont = new System.Drawing.Font(familyName,
          oldFont.Size, oldFont.Style, GraphicsUnit.Point, 0);
        control.Font = newFont;
        //oldFont.Dispose();
      }
      foreach (Control child in control.Controls)
        SetFonts(child);
    }
  </code></pre>
  
  <p>I thought it would keep resources down if I disposed of the old font after reassigning the control with the new one, but on closing the form I'm receiving access violation exceptions from one control type from a set of third party controls. 
  If I comment out the line "oldFont.Dispose()" then I don't get the exception.</p>
  
  <p>Is this a bug of the third party control set or is this to be expected?<br>
  Memory wise, can I get away with not explicitly disposing of the old font (The app runs on kiosks for 12hr+ a day) ?</p>