title: Problem with disposing Graphics in C# running on mono
body: <p>I am creating simple 2D game engine in C#. I am writing it on linux and I use monodevelop to compile it. I found a weird thing happens in my game loop. </p>
  
  <pre><code>Bitmap frame = new Bitmap((int)cam.BaseSize.Width, (int)cam.BaseSize.Height);
  using (Graphics g = Graphics.FromImage(frame))
  {
  //There is nothing inside it for now
  }
  return frame;
  </code></pre>
  
  <p>Bitmap is disposed after returning it, but my memory is slowly running out. I realized that when I comment all lines with graphics and leave creating bitmap and return all my code works perfectly. Is it mono bug or what is happening here?</p>
  
  <p>Mono version: 6.6.0.166<br>
  .NET version: 4.7.2</p>