/[xmltv_parser]/trunk/xmltv_parser/main.cs
ViewVC logotype

Diff of /trunk/xmltv_parser/main.cs

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

--- trunk/xmltv_parser/main.cs	2013/03/08 03:01:48	42
+++ trunk/xmltv_parser/main.cs	2013/03/08 03:36:44	44
@@ -17,6 +17,7 @@
 {
     public partial class main : Form
     {
+        private IXMLTVRuntimeInstance xmltv;
         private bool IsUnix
         {
             get { return System.Environment.OSVersion.Platform == PlatformID.Unix; }
@@ -94,7 +95,7 @@
             ////Programs = program_list(0, program_count).ToList();
             //Programs = new List<IXMLTVProgram>(program_list.ToArray());
 
-            IXMLTVRuntimeInstance xmltv = XMLTV.CreateInstance(schedule_xml);
+            xmltv = XMLTV.CreateInstance(schedule_xml);
             var program_count = xmltv.Programs.Values.Count;
             var program_list = xmltv.Programs.Values.ToList().OrderBy(s => s.Start);
             //Programs = program_list(0, program_count).ToList();
@@ -164,6 +165,14 @@
             catch (Exception ex) { gLog.Log.Error.WriteLine(ex.ToString()); MessageBox.Show(ex.Message, "Failed to save data", MessageBoxButtons.OK, MessageBoxIcon.Error); return; }
             MessageBox.Show("Successfully saved data", "Successfully saved data", MessageBoxButtons.OK, MessageBoxIcon.Information); 
         }
+
+        private void main_FormClosing(object sender, FormClosingEventArgs e)
+        {
+            if (xmltv != null)
+            {
+                xmltv.Dispose();
+            }
+        }
     }
 }
 

 

  ViewVC Help
Powered by ViewVC 1.1.22