/[EmuXPortal]/trunk/EmuXPortal/Api/EmuConfig.cs
ViewVC logotype

Diff of /trunk/EmuXPortal/Api/EmuConfig.cs

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

--- trunk/EmuXPortal/Api/EmuConfig.cs	2012/08/22 02:36:47	105
+++ trunk/EmuXPortal/Api/EmuConfig.cs	2012/08/23 02:44:26	110
@@ -32,6 +32,7 @@
 
 
         void RefreshConfig();
+        void ReleasePlatformImageResource();
     }
 
 
@@ -128,7 +129,7 @@
                                             if (reader.IsStartElement())
                                             {
                                                 string platform_image = reader.ReadElementContentAsString();
-                                                PlatformImage = (platform_image == "") ? Properties.Resources.DefaultPlatformImage : Image.FromFile(string.Format(@"{0}\{1}", rom_path, platform_image));
+                                                PlatformImage = (platform_image == "") ? null : Image.FromFile(string.Format(@"{0}\{1}", rom_path, platform_image));
                                                 string str_platform_image = (platform_image == "") ? "DefaultPlatformImage" : platform_image;
                                                 logger.WriteLine("\t\tPLATFORMIMAGE={0}", str_platform_image);
                                             }
@@ -321,6 +322,12 @@
             public string GameImage { get; set; }
             public string GameExe { get; set; }
             public string GameExeArgs { get; set; }
+
+            public void ReleasePlatformImageResource()
+            {
+                if (this.PlatformImage != null)
+                    this.PlatformImage.Dispose();
+            }
             #endregion
 
             public override string ToString()

 

  ViewVC Help
Powered by ViewVC 1.1.22