summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--spedytor/Form1.Designer.cs1
-rw-r--r--spedytor/Form1.cs5
-rw-r--r--spedytor/Logger.cs8
3 files changed, 14 insertions, 0 deletions
diff --git a/spedytor/Form1.Designer.cs b/spedytor/Form1.Designer.cs
index f411cae..a0f77e3 100644
--- a/spedytor/Form1.Designer.cs
+++ b/spedytor/Form1.Designer.cs
@@ -204,6 +204,7 @@
this.MinimizeBox = false;
this.Name = "Form1";
this.Text = "Spedytor";
+ this.FormClosed += new System.Windows.Forms.FormClosedEventHandler(this.Form1_FormClosed);
this.Load += new System.EventHandler(this.Form1_Load);
((System.ComponentModel.ISupportInitialize)(this.nInterval)).EndInit();
this.ResumeLayout(false);
diff --git a/spedytor/Form1.cs b/spedytor/Form1.cs
index f3f47c6..928682a 100644
--- a/spedytor/Form1.cs
+++ b/spedytor/Form1.cs
@@ -181,5 +181,10 @@ namespace spedytor
{
Logger.getLogger(this.tbLog, LOG_FILENAME).tick();
}
+
+ private void Form1_FormClosed(object sender, FormClosedEventArgs e)
+ {
+ Logger.getLogger(this.tbLog, LOG_FILENAME).cleanup();
+ }
}
}
diff --git a/spedytor/Logger.cs b/spedytor/Logger.cs
index c32d91a..7b88177 100644
--- a/spedytor/Logger.cs
+++ b/spedytor/Logger.cs
@@ -80,5 +80,13 @@ namespace spedytor
}
}
}
+
+ public void cleanup()
+ {
+ if (this.file != null)
+ {
+ this.file.Close();
+ }
+ }
}
}