title: Win32.DestroyIcon vs. Icon.Dispose
body: <p>I have this line of code:</p>
  
  <pre><code>System.Drawing.Icon icon = System.Drawing.Icon.FromHandle(shinfo.hIcon);
  </code></pre>
  
  <p>A few lines later, after icon is used I have the line:</p>
  
  <pre><code>Win32.DestroyIcon(shinfo.hIcon);
  </code></pre>
  
  <p>However when running a static analysis on my code it says there is a potential for Resource_Leak from icon. I am wondering will it make any difference if I call the dispose method:</p>
  
  <pre><code>icon.Dispose();
  </code></pre>
  
  <p>rather than the Win32.DestroyIcon() that is being used right now. Is there any difference between them? I am just maintaining this code so I am not sure if there was any special intnetion by the original developer to use Win32.DestroyIcon.</p>