title: File lock on created image?
body: <p>I'm in the process of hunting down a resource leak in a service and am curious whether or not the following code in fact could be locking this file after it's created. It appears that maybe it's being locked because it's deleted after it's opened, then saved again?</p>
  
  <p><strong>edit in response to comments:</strong></p>
  
  <p>The file is being accessed later and returns an IOException with the message stating that the file cannot be accessed because it is being used by another process.</p>
  
  <p>Also, is the "img = new Bitmap(...) not actually accessing the file when it's created? Or am I off on that?</p>
  
  <pre><code> using (Image img = new Bitmap(imgPath))
   {
       path = m_fpService.GetProcessedPath(irec, true);
       if (File.Exists(imgPath))
       {
           File.Delete(imgPath);
       }
  
       img.RotateFlip((RotateFlipType)adjustedRotation);
       img.Save(imgPath);
   }
  </code></pre>