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

Diff of /trunk/EmuXPortal/Form1.cs

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

--- trunk/EmuXPortal/Form1.cs	2012/08/23 02:20:19	109
+++ trunk/EmuXPortal/Form1.cs	2012/08/23 02:44:26	110
@@ -365,6 +365,7 @@
             else { this.Update(); }
         }
         #region gameWorker
+        private static Image DefaultGameImage = Properties.Resources.DefaultGameImage;
         private void gameWorker_DoWork(object sender, DoWorkEventArgs e)
         {
             Stopwatch t = e.Argument as Stopwatch;
@@ -391,7 +392,8 @@
                 game_ctrl.Dock = DockStyle.Top;
                 game_ctrl.Width = this.Width - 10;
                 game_ctrl.Tag = config;
-                game_ctrl.GameImage = (Image)config.RomImage.Clone();
+                game_ctrl.GameImage = config.RomImage == null ? DefaultGameImage : (Image)config.RomImage.Clone();
+                config.ReleaseRomImageResource();
                 game_ctrl.GameName = config.RomTitle;
                 game_ctrl.PreviewKeyDown += new PreviewKeyDownEventHandler(game_ctrl_PreviewKeyDown);
                 game_ctrl.GotFocus += new EventHandler(game_ctrl_GotFocus);
@@ -422,6 +424,7 @@
         }
         #endregion
         #region platformWorker
+        private static Image DefaultPlatformImage = Properties.Resources.DefaultPlatformImage;
         private void platformWorker_DoWork(object sender, DoWorkEventArgs e)
         {
             Stopwatch t = e.Argument as Stopwatch;
@@ -444,7 +447,8 @@
                 platform_ctrl.Dock = DockStyle.Top;
                 platform_ctrl.Width = this.Width - 10;
                 platform_ctrl.Tag = config;
-                platform_ctrl.PlatformImage = (Image)config.PlatformImage.Clone();
+                platform_ctrl.PlatformImage = config.PlatformImage == null ? DefaultPlatformImage : (Image)config.PlatformImage.Clone();
+                config.ReleasePlatformImageResource();
                 platform_ctrl.PlatformName = config.ToString();
                 platform_ctrl.PreviewKeyDown += new PreviewKeyDownEventHandler(platform_ctrl_PreviewKeyDown);
                 platform_ctrl.GotFocus += new EventHandler(platform_ctrl_GotFocus);

 

  ViewVC Help
Powered by ViewVC 1.1.22