Merge branch 'sgen-android'
[mono.git] / mcs / class / Managed.Windows.Forms / System.Windows.Forms / ToolStripRenderer.cs
index fe40ba3ee8bc79793cb9cf596f9c3e0dbef6187a..1cd5df05bddfade1efbd05860077b62f96b41f24 100644 (file)
@@ -25,7 +25,6 @@
 // Authors:
 //     Jonathan Pobst (monkey@jpobst.com)
 //
-#if NET_2_0
 
 using System;
 using System.ComponentModel;
@@ -60,7 +59,8 @@ namespace System.Windows.Forms
                        ia.SetColorMatrix (grayscale_matrix);
                        
                        Bitmap b = new Bitmap(normalImage.Width, normalImage.Height);
-                       Graphics.FromImage(b).DrawImage(normalImage, new Rectangle (0, 0, normalImage.Width, normalImage.Height), 0, 0, normalImage.Width, normalImage.Height, GraphicsUnit.Pixel, ia);
+                       using (Graphics g = Graphics.FromImage(b))
+                               g.DrawImage(normalImage, new Rectangle (0, 0, normalImage.Width, normalImage.Height), 0, 0, normalImage.Width, normalImage.Height, GraphicsUnit.Pixel, ia);
                        
                        return b;
                }
@@ -564,4 +564,3 @@ namespace System.Windows.Forms
                #endregion
        }
 }
-#endif