ViewVC Help
View File | Revision Log | Show Annotations | Download File | View Changeset | Root Listing
root/xmltv_parser/trunk/xmltv_parser/main.cs
(Generate patch)

Comparing trunk/xmltv_parser/main.cs (file contents):
Revision 43 by william, Fri Mar 8 03:01:48 2013 UTC vs.
Revision 44 by william, Fri Mar 8 03:36:44 2013 UTC

# Line 17 | Line 17 | namespace xmltv_parser
17   {
18      public partial class main : Form
19      {
20 +        private IXMLTVRuntimeInstance xmltv;
21          private bool IsUnix
22          {
23              get { return System.Environment.OSVersion.Platform == PlatformID.Unix; }
# Line 94 | Line 95 | namespace xmltv_parser
95              ////Programs = program_list(0, program_count).ToList();
96              //Programs = new List<IXMLTVProgram>(program_list.ToArray());
97  
98 <            IXMLTVRuntimeInstance xmltv = XMLTV.CreateInstance(schedule_xml);
98 >            xmltv = XMLTV.CreateInstance(schedule_xml);
99              var program_count = xmltv.Programs.Values.Count;
100              var program_list = xmltv.Programs.Values.ToList().OrderBy(s => s.Start);
101              //Programs = program_list(0, program_count).ToList();
# Line 164 | Line 165 | namespace xmltv_parser
165              catch (Exception ex) { gLog.Log.Error.WriteLine(ex.ToString()); MessageBox.Show(ex.Message, "Failed to save data", MessageBoxButtons.OK, MessageBoxIcon.Error); return; }
166              MessageBox.Show("Successfully saved data", "Successfully saved data", MessageBoxButtons.OK, MessageBoxIcon.Information);
167          }
168 +
169 +        private void main_FormClosing(object sender, FormClosingEventArgs e)
170 +        {
171 +            if (xmltv != null)
172 +            {
173 +                xmltv.Dispose();
174 +            }
175 +        }
176      }
177   }
178  

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines