/[EmuXPortal]/trunk/EmuXPortal/GameControl.cs
ViewVC logotype

Diff of /trunk/EmuXPortal/GameControl.cs

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

--- trunk/EmuXPortal/GameControl.cs	2012/10/04 22:07:59	138
+++ trunk/EmuXPortal/GameControl.cs	2012/10/04 22:23:14	139
@@ -16,10 +16,12 @@
         public Image GameImage { get { lock (image_lock) { return gameImage.Image; } } set { lock (image_lock) { gameImage.Image = value; } } }
         public string GameName { get { return gameName.Text; } set { gameName.Text = value; } }
         private void GameControl_Load(object sender, EventArgs e)
-        {
-            Graphics g = gameName.CreateGraphics();
-            Size size = g.MeasureString(gameName.Text, gameName.Font).ToSize();
-            gameName.Size = new Size(size.Width + 5, gameName.Size.Height);
+        {           
+            using (Graphics g = gameName.CreateGraphics())
+            {
+                Size size = g.MeasureString(gameName.Text, gameName.Font).ToSize();
+                gameName.Size = new Size(size.Width + 5, gameName.Size.Height);
+            }
         }
     }
 }

 

  ViewVC Help
Powered by ViewVC 1.1.22